Spaces:
Runtime error
Runtime error
Check for no text
Browse files
app.py
CHANGED
@@ -47,6 +47,7 @@ def model_chat(query: Optional[str], history: Optional[History]) -> Generator[Tu
|
|
47 |
for completion in gen:
|
48 |
print(completion)
|
49 |
text = completion.choices[0].delta.content
|
|
|
50 |
messages[-1]['content'] += text
|
51 |
history = messages_to_history(messages)
|
52 |
yield '', history
|
|
|
47 |
for completion in gen:
|
48 |
print(completion)
|
49 |
text = completion.choices[0].delta.content
|
50 |
+
if not text: continue
|
51 |
messages[-1]['content'] += text
|
52 |
history = messages_to_history(messages)
|
53 |
yield '', history
|