Gazeux33 commited on
Commit
406a152
·
verified ·
1 Parent(s): 8c5c24b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -1,6 +1,7 @@
1
  from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
2
  import datetime
3
  import requests
 
4
  import pytz
5
  import yaml
6
  from tools.final_answer import FinalAnswerTool
@@ -18,6 +19,12 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
18
  """
19
  return "What magic will you build ?"
20
 
 
 
 
 
 
 
21
  @tool
22
  def get_current_time_in_timezone(timezone: str) -> str:
23
  """A tool that fetches the current local time in a specified timezone.
@@ -55,7 +62,7 @@ with open("prompts.yaml", 'r') as stream:
55
 
56
  agent = CodeAgent(
57
  model=model,
58
- tools=[final_answer], ## add your tools here (don't remove final answer)
59
  max_steps=6,
60
  verbosity_level=1,
61
  grammar=None,
 
1
  from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
2
  import datetime
3
  import requests
4
+ import spaces
5
  import pytz
6
  import yaml
7
  from tools.final_answer import FinalAnswerTool
 
19
  """
20
  return "What magic will you build ?"
21
 
22
+
23
+ @spaces.GPU
24
+ def warmup():
25
+ # Dummy call so HF Spaces detects a GPU function at startup
26
+ return True
27
+
28
  @tool
29
  def get_current_time_in_timezone(timezone: str) -> str:
30
  """A tool that fetches the current local time in a specified timezone.
 
62
 
63
  agent = CodeAgent(
64
  model=model,
65
+ tools=[final_answer,image_generation_tool , get_current_time_in_timezone ], ## add your tools here (don't remove final answer)
66
  max_steps=6,
67
  verbosity_level=1,
68
  grammar=None,