Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,14 +23,14 @@ def respond(message, history):
|
|
| 23 |
|
| 24 |
response = ""
|
| 25 |
|
| 26 |
-
for
|
| 27 |
messages,
|
| 28 |
max_tokens=256,
|
| 29 |
temperature=0.7,
|
| 30 |
top_p=0.9,
|
| 31 |
stream=True,
|
| 32 |
):
|
| 33 |
-
token =
|
| 34 |
response += token
|
| 35 |
yield response
|
| 36 |
|
|
|
|
| 23 |
|
| 24 |
response = ""
|
| 25 |
|
| 26 |
+
for chunk in client.chat_completion(
|
| 27 |
messages,
|
| 28 |
max_tokens=256,
|
| 29 |
temperature=0.7,
|
| 30 |
top_p=0.9,
|
| 31 |
stream=True,
|
| 32 |
):
|
| 33 |
+
token = chunk.choices[0].delta.content
|
| 34 |
response += token
|
| 35 |
yield response
|
| 36 |
|