Spaces:
Running
Running
Update main.py
Browse files- app/main.py +9 -1
app/main.py
CHANGED
|
@@ -87,7 +87,15 @@ async def process_input(text: str):
|
|
| 87 |
if text and len(text.strip()) > 0:
|
| 88 |
text = text.strip()
|
| 89 |
streaming_response = session_assistant.ask(text)
|
| 90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
|
| 93 |
@app.post("/upload")
|
|
|
|
| 87 |
if text and len(text.strip()) > 0:
|
| 88 |
text = text.strip()
|
| 89 |
streaming_response = session_assistant.ask(text)
|
| 90 |
+
# res.writeHead(200, {
|
| 91 |
+
# 'Content-Type': 'text/event-stream',
|
| 92 |
+
# 'Cache-Control': 'no-cache',
|
| 93 |
+
# 'Content-Encoding': 'none',
|
| 94 |
+
# 'Connection': 'keep-alive',
|
| 95 |
+
# 'Access-Control-Allow-Origin': '*'
|
| 96 |
+
# });
|
| 97 |
+
# return StreamingResponse(astreamer(streaming_response.response_gen), media_type='text/event-stream')
|
| 98 |
+
return StreamingResponse(streaming_response.response_gen)
|
| 99 |
|
| 100 |
|
| 101 |
@app.post("/upload")
|