davidxia commited on
Commit
cd2b8ab
·
verified ·
1 Parent(s): 828716b

Add text_to_speech tool

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -38,7 +38,7 @@ def get_current_time_in_timezone(timezone: str) -> str:
38
  final_answer = FinalAnswerTool()
39
 
40
  # 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:
41
- # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
42
 
43
  model = HfApiModel(
44
  max_tokens=2096,
@@ -51,14 +51,14 @@ model = HfApiModel(
51
  # Import tool from Hub
52
  image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
53
 
54
- travel_planner_tool = load_tool("m-ric/ai-travel-planner", trust_remote_code=True)
55
 
56
  with open("prompts.yaml", 'r') as stream:
57
  prompt_templates = yaml.safe_load(stream)
58
-
59
  agent = CodeAgent(
60
  model=model,
61
- tools=[get_current_time_in_timezone, fetch_webpage, image_generation_tool, travel_planner_tool, final_answer],
62
  max_steps=6,
63
  verbosity_level=1,
64
  grammar=None,
@@ -69,4 +69,4 @@ agent = CodeAgent(
69
  )
70
 
71
 
72
- GradioUI(agent).launch()
 
38
  final_answer = FinalAnswerTool()
39
 
40
  # 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:
41
+ # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
42
 
43
  model = HfApiModel(
44
  max_tokens=2096,
 
51
  # Import tool from Hub
52
  image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
53
 
54
+ text_to_speech_tool = load_tool("davidxia/text-to-speech", trust_remote_code=True)
55
 
56
  with open("prompts.yaml", 'r') as stream:
57
  prompt_templates = yaml.safe_load(stream)
58
+
59
  agent = CodeAgent(
60
  model=model,
61
+ tools=[get_current_time_in_timezone, fetch_webpage, image_generation_tool, text_to_speech_tool, final_answer],
62
  max_steps=6,
63
  verbosity_level=1,
64
  grammar=None,
 
69
  )
70
 
71
 
72
+ GradioUI(agent).launch()