Spaces:
Sleeping
Sleeping
Update custom_tools/image_description_tool.py
Browse files
custom_tools/image_description_tool.py
CHANGED
|
@@ -71,7 +71,7 @@ class ImageDescriptionTool(BaseTool):
|
|
| 71 |
self.model.to(self.device)
|
| 72 |
self.max_length = 16
|
| 73 |
self.num_beams = 4
|
| 74 |
-
self.gen_kwargs = {"max_length": self.max_length
|
| 75 |
|
| 76 |
def apply(self, image_path: str) -> str:
|
| 77 |
try:
|
|
|
|
| 71 |
self.model.to(self.device)
|
| 72 |
self.max_length = 16
|
| 73 |
self.num_beams = 4
|
| 74 |
+
self.gen_kwargs = {"max_length": self.max_length} # no num_beams = greedy decoding
|
| 75 |
|
| 76 |
def apply(self, image_path: str) -> str:
|
| 77 |
try:
|