Update app.py
Browse files
app.py
CHANGED
@@ -52,8 +52,8 @@ async def chat(request: ChatRequest):
|
|
52 |
try:
|
53 |
data = json.loads(line[len('data: '):])
|
54 |
content = data.get("choices", [{}])[0].get("delta", {}).get("content", '')
|
55 |
-
|
56 |
-
|
57 |
except json.JSONDecodeError:
|
58 |
continue
|
59 |
|
|
|
52 |
try:
|
53 |
data = json.loads(line[len('data: '):])
|
54 |
content = data.get("choices", [{}])[0].get("delta", {}).get("content", '')
|
55 |
+
if content:
|
56 |
+
yield f"{json.dumps({'response': content})}\n\n"
|
57 |
except json.JSONDecodeError:
|
58 |
continue
|
59 |
|