Jaykintecblic
commited on
Commit
•
f0507f9
1
Parent(s):
9d87924
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=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}
|
|
|
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, do_sample=True, num_beams=4, top_k=100,temperature=0.7)
|
62 |
generated_text = self.processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
63 |
# print(generated_text)
|
64 |
# return {"text": generated_text}
|