Spaces:
Runtime error
Runtime error
Update app/main.py
Browse files- app/main.py +4 -3
app/main.py
CHANGED
|
@@ -43,9 +43,10 @@ async def echo(message, history):
|
|
| 43 |
|
| 44 |
history.append([message, ""])
|
| 45 |
full_resp = ""
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
|
|
|
| 49 |
full_resp = full_resp + resp.choices[0].delta.content
|
| 50 |
history[-1][1] = full_resp
|
| 51 |
yield history
|
|
|
|
| 43 |
|
| 44 |
history.append([message, ""])
|
| 45 |
full_resp = ""
|
| 46 |
+
|
| 47 |
+
responses = client.chat.completions.create(model="tgi", messages=messages, **parameters)
|
| 48 |
+
|
| 49 |
+
async for resp in responses:
|
| 50 |
full_resp = full_resp + resp.choices[0].delta.content
|
| 51 |
history[-1][1] = full_resp
|
| 52 |
yield history
|