Dips-1991 commited on
Commit
7c15eca
·
verified ·
1 Parent(s): 34f23aa

Update tools/final_answer.py

Browse files
Files changed (1) hide show
  1. tools/final_answer.py +6 -2
tools/final_answer.py CHANGED
@@ -1,5 +1,9 @@
 
 
 
 
1
  from typing import Any
2
- from smolagents.tools import Tool, AgentImage
3
 
4
  class FinalAnswerTool(Tool):
5
  name = "final_answer"
@@ -12,7 +16,7 @@ class FinalAnswerTool(Tool):
12
 
13
  def forward(self, answer: Any = "", image: Any = None) -> str:
14
  # Handle AgentImage rendering
15
- if isinstance(image, AgentImage):
16
  try:
17
  image_html = image.display() # or image.to_html()
18
  except:
 
1
+
2
+
3
+
4
+
5
  from typing import Any
6
+ from smolagents.tools import Tool
7
 
8
  class FinalAnswerTool(Tool):
9
  name = "final_answer"
 
16
 
17
  def forward(self, answer: Any = "", image: Any = None) -> str:
18
  # Handle AgentImage rendering
19
+ if isinstance(image):
20
  try:
21
  image_html = image.display() # or image.to_html()
22
  except: