Spaces:
Running
Running
Update main.py
Browse files- app/main.py +3 -1
app/main.py
CHANGED
@@ -74,11 +74,13 @@ async def websocket_endpoint(websocket: WebSocket, client_id: int):
|
|
74 |
|
75 |
async def astreamer(generator):
|
76 |
try:
|
|
|
77 |
for i in generator:
|
|
|
78 |
yield (i)
|
79 |
await asyncio.sleep(.1)
|
80 |
except asyncio.CancelledError as e:
|
81 |
-
|
82 |
|
83 |
|
84 |
@app.get("/query")
|
|
|
74 |
|
75 |
async def astreamer(generator):
|
76 |
try:
|
77 |
+
print("streaming........")
|
78 |
for i in generator:
|
79 |
+
print(i)
|
80 |
yield (i)
|
81 |
await asyncio.sleep(.1)
|
82 |
except asyncio.CancelledError as e:
|
83 |
+
yield ('cancelled')
|
84 |
|
85 |
|
86 |
@app.get("/query")
|