OlivierDehaene commited on
Commit
b604dd0
1 Parent(s): 6d82338

strip history

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -72,15 +72,13 @@ def predict(
72
  if partial_words.endswith(assistant_name.rstrip()):
73
  partial_words = partial_words.rstrip(assistant_name.rstrip())
74
 
75
- partial_words = partial_words.strip()
76
-
77
  if i == 0:
78
  history.append(" " + partial_words)
79
  else:
80
  history[-1] = partial_words
81
 
82
  chat = [
83
- (history[i], history[i + 1]) for i in range(0, len(history) - 1, 2)
84
  ]
85
  yield chat, history
86
 
 
72
  if partial_words.endswith(assistant_name.rstrip()):
73
  partial_words = partial_words.rstrip(assistant_name.rstrip())
74
 
 
 
75
  if i == 0:
76
  history.append(" " + partial_words)
77
  else:
78
  history[-1] = partial_words
79
 
80
  chat = [
81
+ (history[i].strip(), history[i + 1].strip()) for i in range(0, len(history) - 1, 2)
82
  ]
83
  yield chat, history
84