winglian commited on
Commit
e86a410
·
1 Parent(s): 178e1da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -54,8 +54,9 @@ def chat(history, system_message, max_tokens, temperature, top_p, top_k, repetit
54
  )
55
  for tokens in prediction:
56
  tokens = re.findall(r'(.*?)(\s|$)', tokens)
57
- for s in tokens:
58
- answer = s
 
59
  history[-1][1] += answer
60
  # stream the response
61
  yield history, history, ""
 
54
  )
55
  for tokens in prediction:
56
  tokens = re.findall(r'(.*?)(\s|$)', tokens)
57
+ for subtoken in tokens:
58
+ subtoken = "".join(subtoken)
59
+ answer = subtoken
60
  history[-1][1] += answer
61
  # stream the response
62
  yield history, history, ""