Genereux-akotenou commited on
Commit
988494f
·
verified ·
1 Parent(s): 64eb4c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -33,7 +33,7 @@ def get_current_time_in_timezone(timezone: str) -> str:
33
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
34
 
35
 
36
- final_answer = FinalAnswerTool()
37
 
38
  # If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
39
  # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
@@ -47,14 +47,16 @@ model = HfApiModel(
47
 
48
 
49
  # Import tool from Hub
 
50
  image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
 
51
 
52
  with open("prompts.yaml", 'r') as stream:
53
  prompt_templates = yaml.safe_load(stream)
54
 
55
  agent = CodeAgent(
56
  model=model,
57
- tools=[final_answer, DuckDuckGoSearchTool(), image_generation_tool()],
58
  max_steps=6,
59
  verbosity_level=1,
60
  grammar=None,
 
33
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
34
 
35
 
36
+
37
 
38
  # If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
39
  # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
 
47
 
48
 
49
  # Import tool from Hub
50
+ final_answer = FinalAnswerTool()
51
  image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
52
+ web_search_tool = DuckDuckGoSearchTool()
53
 
54
  with open("prompts.yaml", 'r') as stream:
55
  prompt_templates = yaml.safe_load(stream)
56
 
57
  agent = CodeAgent(
58
  model=model,
59
+ tools=[final_answer, image_generation_tool, web_search_tool],
60
  max_steps=6,
61
  verbosity_level=1,
62
  grammar=None,