Spaces:
Sleeping
Sleeping
| from smolagents import Tool | |
| from huggingface_hub import InferenceClient | |
| class TextToSpeechTool(Tool): | |
| description = "This tool synthesizes speech from text." | |
| name = "speech_generator" | |
| inputs = {"text": {"type": "string", "description": "The text input"}} | |
| output_type = "audio" | |
| client = InferenceClient() | |
| def forward(self, text): | |
| return self.client.text_to_speech(text) | |