Update handler.py
Browse files- 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
|
| 74 |
|
| 75 |
generation_args = {
|
| 76 |
-
"max_new_tokens": data.get("
|
| 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,
|