qnguyen3 commited on
Commit
9a6167f
1 Parent(s): 3fd9007

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -101,7 +101,7 @@ def bot_streaming(message, history):
101
  stop_str = '<|im_end|>'
102
  keywords = [stop_str]
103
  stopping_criteria = KeywordsStoppingCriteria(keywords, tokenizer, input_ids)
104
- streamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
105
 
106
  image_tensor = model.process_images([image], model.config).to(dtype=model.dtype)
107
  generation_kwargs = dict(input_ids=input_ids.to('cuda'), images=image_tensor.to('cuda'), streamer=streamer, max_new_tokens=100, stopping_criteria=[stopping_criteria])
 
101
  stop_str = '<|im_end|>'
102
  keywords = [stop_str]
103
  stopping_criteria = KeywordsStoppingCriteria(keywords, tokenizer, input_ids)
104
+ streamer = TextIteratorStreamer(tokenizer, skip_prompt=False, skip_special_tokens=True)
105
 
106
  image_tensor = model.process_images([image], model.config).to(dtype=model.dtype)
107
  generation_kwargs = dict(input_ids=input_ids.to('cuda'), images=image_tensor.to('cuda'), streamer=streamer, max_new_tokens=100, stopping_criteria=[stopping_criteria])