qver3nc1a commited on
Commit
f2e0e40
·
verified ·
1 Parent(s): 57fbf63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -1,4 +1,4 @@
1
- from smolagents import CodeAgent, DuckDuckGoSearchTool, InferenceClientModel, load_tool, tool, FinalAnswerTool
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(timezone: str) -> str:
12
  '''A tool that creates a high quality image from the given text.
13
  Args:
14
- text: a string that needs to be converted to text (e.g., cool hedgehog)
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 = InferenceClientModel(
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',