not-lain commited on
Commit
89b12a6
β€’
1 Parent(s): afb805b

🌘wπŸŒ–

Browse files
Files changed (1) hide show
  1. app.py +11 -4
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
- for new_text in streamer:
103
- if new_text is not None:
104
- partial_text += new_text
105
- yield partial_text
 
 
 
 
 
 
 
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