alexkueck commited on
Commit
d162a83
·
1 Parent(s): 4d7722b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -55,6 +55,7 @@ def bot(user_message, history):
55
  print("promt is ready")
56
  stream = client.text_generation(prompt, stream=True, details=True, **gen_kwargs)
57
  print("stream")
 
58
  history[-1][1] = ""
59
  for character in stream:
60
  history[-1][1] += character
@@ -62,6 +63,7 @@ def bot(user_message, history):
62
  yield history
63
 
64
  '''
 
65
  # yield each generated token
66
  for r in stream:
67
  # skip special tokens
@@ -72,8 +74,9 @@ def bot(user_message, history):
72
  break
73
  # yield the generated token
74
  #print(r.token.text, end = "")
75
- yield r.token.text
76
- '''
 
77
 
78
 
79
 
 
55
  print("promt is ready")
56
  stream = client.text_generation(prompt, stream=True, details=True, **gen_kwargs)
57
  print("stream")
58
+ '''
59
  history[-1][1] = ""
60
  for character in stream:
61
  history[-1][1] += character
 
63
  yield history
64
 
65
  '''
66
+ history[-1][1] = ""
67
  # yield each generated token
68
  for r in stream:
69
  # skip special tokens
 
74
  break
75
  # yield the generated token
76
  #print(r.token.text, end = "")
77
+ history[-1][1] += r.token.text
78
+ yield history
79
+
80
 
81
 
82