HuanjinYao commited on
Commit
f966a64
1 Parent(s): 5774921

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -94,7 +94,7 @@ def bot_streaming(message, history):
94
 
95
  image_tensor = image_tensor.unsqueeze(0)
96
  image_tensor = image_tensor.to(dtype=torch.float16, device='cuda', non_blocking=True)
97
- inputs.to(device='cuda', non_blocking=True)
98
 
99
  print('image', image_tensor.shape)
100
  print('inputs', inputs.shape)
@@ -104,11 +104,14 @@ def bot_streaming(message, history):
104
 
105
  generation_kwargs = dict(inputs=inputs, images=image_tensor, streamer=streamer, max_new_tokens=1024, do_sample=False, eos_token_id = terminators)
106
 
107
- print('here?')
108
 
109
  thread = Thread(target=model.generate, kwargs=generation_kwargs)
 
 
 
110
  thread.start()
111
 
 
112
 
113
  buffer = ""
114
  # time.sleep(0.5)
 
94
 
95
  image_tensor = image_tensor.unsqueeze(0)
96
  image_tensor = image_tensor.to(dtype=torch.float16, device='cuda', non_blocking=True)
97
+ inputs = inputs.to(device='cuda', non_blocking=True)
98
 
99
  print('image', image_tensor.shape)
100
  print('inputs', inputs.shape)
 
104
 
105
  generation_kwargs = dict(inputs=inputs, images=image_tensor, streamer=streamer, max_new_tokens=1024, do_sample=False, eos_token_id = terminators)
106
 
 
107
 
108
  thread = Thread(target=model.generate, kwargs=generation_kwargs)
109
+
110
+ print('here?')
111
+
112
  thread.start()
113
 
114
+ print('start')
115
 
116
  buffer = ""
117
  # time.sleep(0.5)