Jaykintecblic
commited on
Commit
•
a8a8a76
1
Parent(s):
b849bba
Update handler.py
Browse files- handler.py +1 -1
handler.py
CHANGED
@@ -58,7 +58,7 @@ class EndpointHandler:
|
|
58 |
inputs["pixel_values"] = self.processor.image_processor([image], transform=self.custom_transform)
|
59 |
inputs = {k: v.to(self.device) for k, v in inputs.items()}
|
60 |
|
61 |
-
generated_ids = self.model.generate(**inputs, bad_words_ids=self.bad_words_ids, max_length=
|
62 |
generated_text = self.processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
63 |
# print(generated_text)
|
64 |
# return {"text": generated_text}
|
|
|
58 |
inputs["pixel_values"] = self.processor.image_processor([image], transform=self.custom_transform)
|
59 |
inputs = {k: v.to(self.device) for k, v in inputs.items()}
|
60 |
|
61 |
+
generated_ids = self.model.generate(**inputs, bad_words_ids=self.bad_words_ids, max_length=2048, early_stopping=True)
|
62 |
generated_text = self.processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
63 |
# print(generated_text)
|
64 |
# return {"text": generated_text}
|