Spaces:
Paused
Paused
Update app.py
Browse files251 unmodified lines252253254255256257258259260251 unmodified lineselse:return "Error: Invalid model selection", Nonewith tempfile.NamedTemporaryFile(delete=False, mode='w', suffix='.txt') as f:f.write(summary)download_file = f.namereturn summary, download_file251 unmodified lines252253254255256257258259260261262263264265251 unmodified lineselse:return "Error: Invalid model selection", Nonetry: # for file operationswith tempfile.NamedTemporaryFile(mode='w+', suffix='.txt', delete=False) as f: # w+ for write and readf.write(summary)f.flush() # Ensure data is written to diskf.seek(0) # Rewind to the beginning of the filedownload_file = f.nameexcept Exception as file_error:return f"Error creating summary file: {file_error}", Nonereturn summary, download_file
app.py+8-3