alvarobartt HF Staff commited on
Commit
0aea239
·
verified ·
1 Parent(s): f136f90

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +2 -2
handler.py CHANGED
@@ -70,10 +70,10 @@ class EndpointHandler:
70
  inputs = self.processor(images=images, texts=prompt, return_tensors="pt")
71
  inputs["pixel_values"] = inputs["pixel_values"].unsqueeze(0)
72
  inputs["image_sizes"] = inputs["image_sizes"].unsqueeze(0)
73
- inputs = inputs.to("cuda").to(torch.bfloat16)
74
 
75
  generation_args = {
76
- "max_new_tokens": data.get("max_tokens", data.get("max_new_tokens", 128)),
77
  "temperature": data.get("temperature", 0.7),
78
  "do_sample": False,
79
  "use_cache": True,
 
70
  inputs = self.processor(images=images, texts=prompt, return_tensors="pt")
71
  inputs["pixel_values"] = inputs["pixel_values"].unsqueeze(0)
72
  inputs["image_sizes"] = inputs["image_sizes"].unsqueeze(0)
73
+ inputs.to("cuda").to(torch.bfloat16)
74
 
75
  generation_args = {
76
+ "max_new_tokens": data.get("max_new_tokens", data.get("max_tokens", 128)),
77
  "temperature": data.get("temperature", 0.7),
78
  "do_sample": False,
79
  "use_cache": True,