vilarin commited on
Commit
b4d1f01
β€’
1 Parent(s): 8ea3132

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -63,10 +63,11 @@ def stream_chat(message: str, history: list, temperature: float, max_length: int
63
  with torch.no_grad():
64
  thread = Thread(target=model.generate, kwargs=gen_kwargs)
65
  thread.start()
66
- for new_token in streamer:
67
- if new_token:
68
- history[-1][1] += new_token
69
- yield history
 
70
 
71
 
72
 
 
63
  with torch.no_grad():
64
  thread = Thread(target=model.generate, kwargs=gen_kwargs)
65
  thread.start()
66
+ buffer = ""
67
+ for new_text in streamer:
68
+ buffer += new_text
69
+ print(buffer)
70
+ yield buffer
71
 
72
 
73