mgoin commited on
Commit
a10abb5
1 Parent(s): 0175c44

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -112,12 +112,14 @@ with gr.Blocks() as demo:
112
  "max_new_tokens": max_new_tokens,
113
  "temperature": temperature,
114
  }
115
- inference = pipe(sequences=message, streaming=True, **generation_config)
116
  history[-1][1] += message
117
- for token in inference:
118
- history[-1][1] += token.generations[0].text
119
- yield history
 
120
  print(pipe.timer_manager)
 
121
 
122
  textbox.submit(
123
  fn=clear_and_save_textbox,
 
112
  "max_new_tokens": max_new_tokens,
113
  "temperature": temperature,
114
  }
115
+ inference = pipe(sequences=message, streaming=False, **generation_config)
116
  history[-1][1] += message
117
+ history[-1][1] += inference.generations[0].text
118
+ # for token in inference:
119
+ # history[-1][1] += token.generations[0].text
120
+ # yield history
121
  print(pipe.timer_manager)
122
+ return history
123
 
124
  textbox.submit(
125
  fn=clear_and_save_textbox,