return only last bit of message
Browse files
app.py
CHANGED
@@ -123,12 +123,12 @@ def chat_with_model(messages):
|
|
123 |
|
124 |
print(f'Step 2: {messages}')
|
125 |
|
126 |
-
yield messages
|
127 |
|
128 |
if in_think:
|
129 |
output_text += "*"
|
130 |
messages[-1]["content"] = output_text
|
131 |
-
yield messages
|
132 |
|
133 |
# Wait for thread to finish
|
134 |
thread.join(timeout=1.0)
|
@@ -137,7 +137,7 @@ def chat_with_model(messages):
|
|
137 |
|
138 |
print(f'Step 3: {messages}')
|
139 |
|
140 |
-
return messages
|
141 |
|
142 |
|
143 |
|
|
|
123 |
|
124 |
print(f'Step 2: {messages}')
|
125 |
|
126 |
+
yield messages[-1]["content"]
|
127 |
|
128 |
if in_think:
|
129 |
output_text += "*"
|
130 |
messages[-1]["content"] = output_text
|
131 |
+
yield messages[-1]["content"]
|
132 |
|
133 |
# Wait for thread to finish
|
134 |
thread.join(timeout=1.0)
|
|
|
137 |
|
138 |
print(f'Step 3: {messages}')
|
139 |
|
140 |
+
return messages[-1]["content"]
|
141 |
|
142 |
|
143 |
|