Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -105,11 +105,11 @@ def chat_with_llama_stream(messages, model="gpt-3.5-turbo", max_llm_history=4, m
|
|
105 |
)
|
106 |
|
107 |
full_response = ""
|
108 |
-
for
|
109 |
-
if
|
110 |
-
|
111 |
-
full_response +=
|
112 |
-
yield
|
113 |
|
114 |
# After streaming, add the full response to the conversation history
|
115 |
messages.append({"role": "assistant", "content": full_response})
|
|
|
105 |
)
|
106 |
|
107 |
full_response = ""
|
108 |
+
for chunk in response:
|
109 |
+
if chunk.choices[0].delta.content is not None:
|
110 |
+
content = chunk.choices[0].delta.content
|
111 |
+
full_response += content
|
112 |
+
yield content
|
113 |
|
114 |
# After streaming, add the full response to the conversation history
|
115 |
messages.append({"role": "assistant", "content": full_response})
|