Spaces:
Sleeping
Sleeping
Change to use text_to_speech
Browse files
README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
---
|
2 |
-
title: Text To
|
3 |
emoji: 👀
|
4 |
colorFrom: blue
|
5 |
colorTo: indigo
|
|
|
1 |
---
|
2 |
+
title: Text To Speech
|
3 |
emoji: 👀
|
4 |
colorFrom: blue
|
5 |
colorTo: indigo
|
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
from transformers import launch_gradio_demo
|
2 |
-
from tool import
|
3 |
|
4 |
-
launch_gradio_demo(
|
|
|
1 |
from transformers import launch_gradio_demo
|
2 |
+
from tool import TextToSpeechTool
|
3 |
|
4 |
+
launch_gradio_demo(TextToSpeechTool)
|
tool.py
CHANGED
@@ -2,14 +2,13 @@ from smolagents import Tool
|
|
2 |
from huggingface_hub import InferenceClient
|
3 |
|
4 |
|
5 |
-
class
|
6 |
-
description = "This tool
|
7 |
-
name = "
|
8 |
-
inputs = {"
|
9 |
-
output_type = "
|
10 |
-
|
11 |
-
client = InferenceClient(model_sdxl)
|
12 |
|
13 |
|
14 |
-
def forward(self,
|
15 |
-
return self.client.
|
|
|
2 |
from huggingface_hub import InferenceClient
|
3 |
|
4 |
|
5 |
+
class TextToSpeechTool(Tool):
|
6 |
+
description = "This tool synthesizes speech from text."
|
7 |
+
name = "speech_generator"
|
8 |
+
inputs = {"text": {"type": "string", "description": "The text input"}}
|
9 |
+
output_type = "audio"
|
10 |
+
client = InferenceClient()
|
|
|
11 |
|
12 |
|
13 |
+
def forward(self, text):
|
14 |
+
return self.client.text_to_speech(text)
|
tool_config.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
{
|
2 |
-
"description": "This is a tool that
|
3 |
-
"inputs": "{'prompt': {'type': 'string', 'description': \"The
|
4 |
-
"name": "
|
5 |
-
"output_type": "
|
6 |
-
"tool_class": "tool.
|
7 |
}
|
|
|
1 |
{
|
2 |
+
"description": "This is a tool that synthesizes speech from text.",
|
3 |
+
"inputs": "{'prompt': {'type': 'string', 'description': \"The text input"}}",
|
4 |
+
"name": "speech_generator",
|
5 |
+
"output_type": "audio",
|
6 |
+
"tool_class": "tool.TextToSpeechTool"
|
7 |
}
|