Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ from PIL import Image
|
|
| 10 |
from io import BytesIO
|
| 11 |
import base64
|
| 12 |
from smolagents import load_tool
|
| 13 |
-
|
| 14 |
|
| 15 |
model = InferenceClientModel("qwen/Qwen2.5-0.5B-Instruct",
|
| 16 |
max_tokens=512,
|
|
@@ -40,7 +40,7 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 40 |
class ImageCaptioningTool(Tool):
|
| 41 |
name = "image_captioner"
|
| 42 |
description = "Generate a caption for an image."
|
| 43 |
-
inputs = {"image":
|
| 44 |
output_type = "text"
|
| 45 |
|
| 46 |
def run(self, inputs: dict) -> str:
|
|
|
|
| 10 |
from io import BytesIO
|
| 11 |
import base64
|
| 12 |
from smolagents import load_tool
|
| 13 |
+
from typing import Dict
|
| 14 |
|
| 15 |
model = InferenceClientModel("qwen/Qwen2.5-0.5B-Instruct",
|
| 16 |
max_tokens=512,
|
|
|
|
| 40 |
class ImageCaptioningTool(Tool):
|
| 41 |
name = "image_captioner"
|
| 42 |
description = "Generate a caption for an image."
|
| 43 |
+
inputs = {"image": Dict, "question": "str"}
|
| 44 |
output_type = "text"
|
| 45 |
|
| 46 |
def run(self, inputs: dict) -> str:
|