qnguyen3 commited on
Commit
c8dd2ad
1 Parent(s): b9312e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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(tokenizer, **{"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()
 
60
  input_ids = torch.tensor(text_chunks[0] + [-200] + text_chunks[1], dtype=torch.long).unsqueeze(0)
61
  streamer = TextIteratorStreamer(tokenizer, **{"skip_special_tokens": True})
62
  image_tensor = model.process_images([image], model.config).to(dtype=model.dtype)
63
+ generation_kwargs = dict(inputs=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()