yejunliang23 commited on
Commit
0790528
Β·
unverified Β·
1 Parent(s): bfa3b2d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -122,7 +122,7 @@ def add_text(history, task_history, text):
122
  task_history = task_history if task_history is not None else []
123
  history = history + [(_parse_text(text), None)]
124
  task_history = task_history + [(task_text, None)]
125
- return history, task_history, ""
126
 
127
  def add_file(history, task_history, file):
128
  history = history if history is not None else []
@@ -189,9 +189,9 @@ def chat_qwen_vl(messages: str, history: list, temperature: float = 0.1, max_new
189
  inputs = inputs.to(model.device)
190
 
191
  streamer = TextIteratorStreamer(
192
- tokenizer, timeout=2000.0, skip_prompt=True, skip_special_tokens=True)
193
 
194
- gen_kwargs = {'max_new_tokens': 128, 'streamer': streamer, **inputs}
195
 
196
  thread = Thread(target=model.generate, kwargs=gen_kwargs)
197
  thread.start()
 
122
  task_history = task_history if task_history is not None else []
123
  history = history + [(_parse_text(text), None)]
124
  task_history = task_history + [(task_text, None)]
125
+ return history, task_history
126
 
127
  def add_file(history, task_history, file):
128
  history = history if history is not None else []
 
189
  inputs = inputs.to(model.device)
190
 
191
  streamer = TextIteratorStreamer(
192
+ tokenizer, timeout=20.0, skip_prompt=True, skip_special_tokens=True)
193
 
194
+ gen_kwargs = {'max_new_tokens': 512, 'streamer': streamer, **inputs}
195
 
196
  thread = Thread(target=model.generate, kwargs=gen_kwargs)
197
  thread.start()