Update app.py
Browse files
app.py
CHANGED
@@ -152,11 +152,11 @@ def talk(prompt, history):
|
|
152 |
]
|
153 |
# indicates the end of a sequence
|
154 |
text = ""
|
155 |
-
stream = model.create_chat_completion(messages, max_tokens=1000, stop=["</s>"], stream=
|
156 |
-
|
157 |
-
for output in stream:
|
158 |
-
text += output["choices"][0]["text"]
|
159 |
-
yield text
|
160 |
|
161 |
# model_input = model.create_chat_completion(messages = messages)
|
162 |
|
|
|
152 |
]
|
153 |
# indicates the end of a sequence
|
154 |
text = ""
|
155 |
+
stream = model.create_chat_completion(messages, max_tokens=1000, stop=["</s>"], stream=False)
|
156 |
+
return stream
|
157 |
+
# for output in stream:
|
158 |
+
# text += output["choices"][0]["text"]
|
159 |
+
# yield text
|
160 |
|
161 |
# model_input = model.create_chat_completion(messages = messages)
|
162 |
|