Spaces:
Runtime error
Runtime error
Commit
·
639b64b
1
Parent(s):
6f32094
Update app.py
Browse files
app.py
CHANGED
@@ -52,13 +52,15 @@ def predict(message, chatbot):
|
|
52 |
if decoded_line.startswith('data:'):
|
53 |
json_line = decoded_line[5:] # Exclude the first 5 characters ('data:')
|
54 |
else:
|
55 |
-
gr.Warning(f"This line does not start with 'data:': {decoded_line}")
|
56 |
-
json_line = decoded_line
|
|
|
57 |
continue
|
58 |
|
59 |
# Load as JSON
|
60 |
try:
|
61 |
json_obj = json.loads(json_line)[0]
|
|
|
62 |
if 'generated_text' in json_obj:
|
63 |
partial_message = partial_message + json_obj['generated_text']#['token']['text']
|
64 |
yield partial_message
|
|
|
52 |
if decoded_line.startswith('data:'):
|
53 |
json_line = decoded_line[5:] # Exclude the first 5 characters ('data:')
|
54 |
else:
|
55 |
+
#gr.Warning(f"This line does not start with 'data:': {decoded_line}")
|
56 |
+
json_line = decoded_line
|
57 |
+
print(decoded_line)
|
58 |
continue
|
59 |
|
60 |
# Load as JSON
|
61 |
try:
|
62 |
json_obj = json.loads(json_line)[0]
|
63 |
+
print (json_obj)
|
64 |
if 'generated_text' in json_obj:
|
65 |
partial_message = partial_message + json_obj['generated_text']#['token']['text']
|
66 |
yield partial_message
|