wishmi1234 commited on
Commit
80144a6
·
verified ·
1 Parent(s): c61c96d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -32,18 +32,18 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
32
  # def forward(self, image: Image.Image) -> str:
33
  # return "This is a placeholder caption for the uploaded image."
34
 
35
- class ImageCaptioningTool(Tool):
36
- name = "image_captioner"
37
- description = "Generate a caption for an image."
38
- inputs = {"image": "image"}
39
- output_type = "text"
40
 
41
- def run(self, inputs: dict) -> str:
42
- image = inputs.get("image")
43
- if not image:
44
- return "No image provided."
45
- # You could run your model here instead
46
- return "This is a placeholder caption for the uploaded image."
47
 
48
  class BasicAgent:
49
  def __init__(self):
@@ -54,7 +54,7 @@ class BasicAgent:
54
  WikipediaSearchTool(user_agent="my-agent", language="en"),
55
  PythonInterpreterTool(),
56
  UserInputTool(),
57
- ImageCaptioningTool(),
58
  ],
59
  model=model,
60
  system_prompt="""
 
32
  # def forward(self, image: Image.Image) -> str:
33
  # return "This is a placeholder caption for the uploaded image."
34
 
35
+ # class ImageCaptioningTool(Tool):
36
+ # name = "image_captioner"
37
+ # description = "Generate a caption for an image."
38
+ # inputs = {"image": "image"}
39
+ # output_type = "text"
40
 
41
+ # def run(self, inputs: dict) -> str:
42
+ # image = inputs.get("image")
43
+ # if not image:
44
+ # return "No image provided."
45
+ # # You could run your model here instead
46
+ # return "This is a placeholder caption for the uploaded image."
47
 
48
  class BasicAgent:
49
  def __init__(self):
 
54
  WikipediaSearchTool(user_agent="my-agent", language="en"),
55
  PythonInterpreterTool(),
56
  UserInputTool(),
57
+ # ImageCaptioningTool(),
58
  ],
59
  model=model,
60
  system_prompt="""