Spaces:
Runtime error
Runtime error
bug fix
Browse files
app.py
CHANGED
|
@@ -39,7 +39,7 @@ def predict(message, chatbot):
|
|
| 39 |
if decoded_line.startswith('data:'):
|
| 40 |
json_line = decoded_line[5:] # Exclude the first 5 characters ('data:')
|
| 41 |
else:
|
| 42 |
-
|
| 43 |
continue
|
| 44 |
|
| 45 |
# Load as JSON
|
|
@@ -47,7 +47,7 @@ def predict(message, chatbot):
|
|
| 47 |
partial_message = partial_message + json.loads(json_line)['token']['text']
|
| 48 |
yield partial_message
|
| 49 |
except json.JSONDecodeError:
|
| 50 |
-
|
| 51 |
continue
|
| 52 |
|
| 53 |
gr.ChatInterface(predict, title=title, description=description, css=css).queue(concurrency_count=75).launch()
|
|
|
|
| 39 |
if decoded_line.startswith('data:'):
|
| 40 |
json_line = decoded_line[5:] # Exclude the first 5 characters ('data:')
|
| 41 |
else:
|
| 42 |
+
print("This line does not start with 'data:':", decoded_line)
|
| 43 |
continue
|
| 44 |
|
| 45 |
# Load as JSON
|
|
|
|
| 47 |
partial_message = partial_message + json.loads(json_line)['token']['text']
|
| 48 |
yield partial_message
|
| 49 |
except json.JSONDecodeError:
|
| 50 |
+
print("This line is not valid JSON: ", json_line)
|
| 51 |
continue
|
| 52 |
|
| 53 |
gr.ChatInterface(predict, title=title, description=description, css=css).queue(concurrency_count=75).launch()
|