Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from smolagents import CodeAgent, DuckDuckGoSearchTool,
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
|
@@ -8,12 +8,12 @@ from tools.final_answer import FinalAnswerTool
|
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
@tool
|
| 11 |
-
def text_to_image(
|
| 12 |
'''A tool that creates a high quality image from the given text.
|
| 13 |
Args:
|
| 14 |
-
|
| 15 |
'''
|
| 16 |
-
return
|
| 17 |
|
| 18 |
@tool
|
| 19 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
@@ -30,7 +30,7 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 30 |
|
| 31 |
final_answer = FinalAnswerTool()
|
| 32 |
|
| 33 |
-
model =
|
| 34 |
max_tokens = 2096,
|
| 35 |
temperature = 0.5,
|
| 36 |
model_id = 'Qwen/Qwen2.5-Coder-32B-Instruct',
|
|
|
|
| 1 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, tool
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
|
|
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
@tool
|
| 11 |
+
def text_to_image(prompt: str) -> img:
|
| 12 |
'''A tool that creates a high quality image from the given text.
|
| 13 |
Args:
|
| 14 |
+
prompt: a string that needs to be converted to text (e.g., cool hedgehog)
|
| 15 |
'''
|
| 16 |
+
return image_generation_tool(prompt)
|
| 17 |
|
| 18 |
@tool
|
| 19 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 30 |
|
| 31 |
final_answer = FinalAnswerTool()
|
| 32 |
|
| 33 |
+
model = HfApiModel(
|
| 34 |
max_tokens = 2096,
|
| 35 |
temperature = 0.5,
|
| 36 |
model_id = 'Qwen/Qwen2.5-Coder-32B-Instruct',
|