HUANG-Stephanie commited on
Commit
aaf0cd4
1 Parent(s): 5306b43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -120,7 +120,10 @@ async def search(query: str, k: int):
120
  pdf_buffer.seek(0)
121
 
122
  # Use StreamingResponse to handle in-memory file
123
- return StreamingResponse(pdf_buffer, media_type='application/pdf', filename='search_results.pdf')
 
124
 
 
 
125
  if __name__ == "__main__":
126
  uvicorn.run(app, host="0.0.0.0", port=7860)
 
120
  pdf_buffer.seek(0)
121
 
122
  # Use StreamingResponse to handle in-memory file
123
+ response = StreamingResponse(pdf_buffer, media_type='application/pdf')
124
+ response.headers['Content-Disposition'] = 'attachment; filename="search_results.pdf"'
125
 
126
+ return response
127
+
128
  if __name__ == "__main__":
129
  uvicorn.run(app, host="0.0.0.0", port=7860)