baohuynhbk14 commited on
Commit
b6367f6
·
1 Parent(s): b30d21d

Move pixel value computation to GPU for improved performance in http_bot function

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -228,7 +228,7 @@ def http_bot(
228
  # response = requests.post(worker_addr, json=pload, headers=headers, stream=True, timeout=300)
229
  print(f"all_image_paths: {all_image_paths}")
230
 
231
- pixel_values = load_image(all_image_paths[0], max_num=6).to(torch.bfloat16)
232
  print(f"pixel_values: {pixel_values}")
233
  generation_config = dict(max_new_tokens= 700, do_sample=False, num_beams = 3, repetition_penalty=2.5)
234
  message = state.get_user_message(source=state.USER)
 
228
  # response = requests.post(worker_addr, json=pload, headers=headers, stream=True, timeout=300)
229
  print(f"all_image_paths: {all_image_paths}")
230
 
231
+ pixel_values = load_image(all_image_paths[0], max_num=6).to(torch.bfloat16).cuda()
232
  print(f"pixel_values: {pixel_values}")
233
  generation_config = dict(max_new_tokens= 700, do_sample=False, num_beams = 3, repetition_penalty=2.5)
234
  message = state.get_user_message(source=state.USER)