Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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=
|
| 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])
|