fix
Browse files
app.py
CHANGED
@@ -114,6 +114,7 @@ def chat_with_model(messages):
|
|
114 |
# Early stopping if user reappears
|
115 |
if "\nUser:" in output_text:
|
116 |
output_text = output_text.split("\nUser:")[0].rstrip()
|
|
|
117 |
break
|
118 |
|
119 |
# Strip prompt from start of generated output
|
@@ -135,8 +136,7 @@ def chat_with_model(messages):
|
|
135 |
if in_think:
|
136 |
output_text += "*"
|
137 |
messages[-1]["content"] = output_text
|
138 |
-
|
139 |
-
|
140 |
# Wait for thread to finish
|
141 |
thread.join(timeout=1.0)
|
142 |
current_model.to("cpu")
|
@@ -145,7 +145,7 @@ def chat_with_model(messages):
|
|
145 |
messages[-1]["content"] = output_text
|
146 |
print(f'Step 3: {messages}')
|
147 |
|
148 |
-
|
149 |
|
150 |
|
151 |
|
|
|
114 |
# Early stopping if user reappears
|
115 |
if "\nUser:" in output_text:
|
116 |
output_text = output_text.split("\nUser:")[0].rstrip()
|
117 |
+
messages[-1]["content"] = output_text
|
118 |
break
|
119 |
|
120 |
# Strip prompt from start of generated output
|
|
|
136 |
if in_think:
|
137 |
output_text += "*"
|
138 |
messages[-1]["content"] = output_text
|
139 |
+
|
|
|
140 |
# Wait for thread to finish
|
141 |
thread.join(timeout=1.0)
|
142 |
current_model.to("cpu")
|
|
|
145 |
messages[-1]["content"] = output_text
|
146 |
print(f'Step 3: {messages}')
|
147 |
|
148 |
+
yield messages
|
149 |
|
150 |
|
151 |
|