Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
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)
|