Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -60,7 +60,7 @@ def bot_streaming(message, history):
|
|
60 |
input_ids = torch.tensor(text_chunks[0] + [-200] + text_chunks[1], dtype=torch.long).unsqueeze(0)
|
61 |
streamer = TextIteratorStreamer(input_ids, **{"skip_special_tokens": True})
|
62 |
image_tensor = model.process_images([image], model.config).to(dtype=model.dtype)
|
63 |
-
generation_kwargs = dict(
|
64 |
generated_text = ""
|
65 |
thread = Thread(target=model.generate, kwargs=generation_kwargs)
|
66 |
thread.start()
|
|
|
60 |
input_ids = torch.tensor(text_chunks[0] + [-200] + text_chunks[1], dtype=torch.long).unsqueeze(0)
|
61 |
streamer = TextIteratorStreamer(input_ids, **{"skip_special_tokens": True})
|
62 |
image_tensor = model.process_images([image], model.config).to(dtype=model.dtype)
|
63 |
+
generation_kwargs = dict(input_ids, images=image_tensor, streamer=streamer, max_new_tokens=100)
|
64 |
generated_text = ""
|
65 |
thread = Thread(target=model.generate, kwargs=generation_kwargs)
|
66 |
thread.start()
|