Spaces:
Running
on
Zero
Running
on
Zero
πwπ
Browse files
app.py
CHANGED
|
@@ -99,10 +99,17 @@ def talk(message, history):
|
|
| 99 |
time.sleep(1)
|
| 100 |
# Initialize an empty string to store the generated text
|
| 101 |
partial_text = ""
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
partial_text += resources
|
| 107 |
yield partial_text
|
| 108 |
|
|
|
|
| 99 |
time.sleep(1)
|
| 100 |
# Initialize an empty string to store the generated text
|
| 101 |
partial_text = ""
|
| 102 |
+
i = 0
|
| 103 |
+
while t.is_alive():
|
| 104 |
+
try:
|
| 105 |
+
for new_text in streamer:
|
| 106 |
+
if new_text is not None:
|
| 107 |
+
partial_text += new_text
|
| 108 |
+
yield partial_text
|
| 109 |
+
except Exception as e:
|
| 110 |
+
print(f"retry number {i}\ LOGS:\n")
|
| 111 |
+
i+=1
|
| 112 |
+
print(e, e.args)
|
| 113 |
partial_text += resources
|
| 114 |
yield partial_text
|
| 115 |
|