Solobrad commited on
Commit
3d636d6
·
verified ·
1 Parent(s): e77935a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -33,7 +33,19 @@ def get_current_time_in_timezone(timezone: str) -> str:
33
  except Exception as e:
34
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
35
 
36
-
 
 
 
 
 
 
 
 
 
 
 
 
37
  final_answer = FinalAnswerTool()
38
 
39
  # 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:
 
33
  except Exception as e:
34
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
35
 
36
+ @tool
37
+ def generate_music(prompt: str) -> str:
38
+ """
39
+ A tool that generates music based on the given prompt.
40
+ Args:
41
+ prompt: A string describing the style or mood of the music.
42
+ Returns:
43
+ A string representation or link to the generated music.
44
+ """
45
+ music_generator = pipeline("text-to-audio", model="facebook/musicgen-small")
46
+ music_output = music_generator(prompt, do_sample=True)
47
+ return str(music_output)
48
+
49
  final_answer = FinalAnswerTool()
50
 
51
  # 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: