Update app.py
Browse files
app.py
CHANGED
@@ -100,7 +100,7 @@ def bot_streaming(message, history):
|
|
100 |
streamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
|
101 |
|
102 |
image_tensor = model.process_images([image], model.config).to(dtype=model.dtype)
|
103 |
-
generation_kwargs = dict(input_ids=input_ids, images=image_tensor, streamer=streamer, max_new_tokens=100, stopping_criteria=[stopping_criteria])
|
104 |
generated_text = ""
|
105 |
thread = Thread(target=model.generate, kwargs=generation_kwargs)
|
106 |
thread.start()
|
|
|
100 |
streamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
|
101 |
|
102 |
image_tensor = model.process_images([image], model.config).to(dtype=model.dtype)
|
103 |
+
generation_kwargs = dict(input_ids=input_ids.to("cuda:0"), images=image_tensor, streamer=streamer, max_new_tokens=100, stopping_criteria=[stopping_criteria])
|
104 |
generated_text = ""
|
105 |
thread = Thread(target=model.generate, kwargs=generation_kwargs)
|
106 |
thread.start()
|