MaziyarPanahi commited on
Commit
099dbb9
1 Parent(s): ca71034

Update app.py (#14)

Browse files

- Update app.py (867b9556e6b5ebad5530c7fa5a5d029517139a12)

Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -74,7 +74,14 @@ def bot_streaming(message, history):
74
  inputs = processor(prompt, [image], return_tensors='pt').to("cuda:0")
75
 
76
  streamer = TextIteratorStreamer(processor, **{"skip_special_tokens": False, "skip_prompt": True})
77
- generation_kwargs = dict(inputs, streamer=streamer, max_new_tokens=1024, do_sample=False, eos_token_id=processor.tokenizer.eos_token_id)
 
 
 
 
 
 
 
78
 
79
  thread = Thread(target=model.generate, kwargs=generation_kwargs)
80
  thread.start()
 
74
  inputs = processor(prompt, [image], return_tensors='pt').to("cuda:0")
75
 
76
  streamer = TextIteratorStreamer(processor, **{"skip_special_tokens": False, "skip_prompt": True})
77
+ generation_kwargs = dict(
78
+ inputs,
79
+ streamer=streamer,
80
+ max_new_tokens=1024,
81
+ do_sample=False,
82
+ temperature=0.0,
83
+ eos_token_id=processor.tokenizer.eos_token_id
84
+ )
85
 
86
  thread = Thread(target=model.generate, kwargs=generation_kwargs)
87
  thread.start()