Spaces:
Paused
Paused
Update app.py
Browse files251 unmodified lines252253254255256257255256257258259260261262263264265251 unmodified lines else: return "Error: Invalid model selection", None
with tempfile.NamedTemporaryFile(delete=False, mode='w', suffix='.txt') as f: f.write(summary) download_file = f.name try: # for file operations with tempfile.NamedTemporaryFile(mode='w+', suffix='.txt', delete=False) as f: # w+ for write and read f.write(summary) f.flush() # Ensure data is written to disk f.seek(0) # Rewind to the beginning of the file download_file = f.name except Exception as file_error: return f"Error creating summary file: {file_error}", None
return summary, download_file
app.py+8-3