Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,29 @@
|
|
1 |
from gradio_client import Client, handle_file
|
|
|
2 |
|
3 |
-
client = Client("ResembleAI/Chatterbox")
|
4 |
-
result = client.predict(
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
print(result)
|
|
|
1 |
from gradio_client import Client, handle_file
|
2 |
+
client = Client("ResembleAI/Chatterbox", hf_token="your_huggingface_token")
|
3 |
|
4 |
+
# client = Client("ResembleAI/Chatterbox")
|
5 |
+
# result = client.predict(
|
6 |
+
# text_input="Now let's make my mum's favourite. So three mars bars into the pan. Then we add the tuna and just stir for a bit, just let the chocolate and fish infuse. A sprinkle of olive oil and some tomato ketchup. Now smell that. Oh boy this is going to be incredible.",
|
7 |
+
# audio_prompt_path_input=handle_file('https://github.com/gradio-app/gradio/raw/main/test/test_files/audio_sample.wav'),
|
8 |
+
# exaggeration_input=0.5,
|
9 |
+
# temperature_input=0.8,
|
10 |
+
# seed_num_input=0,
|
11 |
+
# cfgw_input=0.5,
|
12 |
+
# api_name="/generate_tts_audio"
|
13 |
)
|
14 |
+
|
15 |
+
try:
|
16 |
+
result = client.predict(
|
17 |
+
text_input=text_input,
|
18 |
+
audio_prompt_path_input=handle_file(audio_prompt_url),
|
19 |
+
exaggeration_input=exaggeration_input,
|
20 |
+
temperature_input=temperature_input,
|
21 |
+
seed_num_input=seed_num_input,
|
22 |
+
cfgw_input=cfgw_input,
|
23 |
+
api_name="/generate_tts_audio"
|
24 |
+
)
|
25 |
+
except Exception as e:
|
26 |
+
print(f"An error occurred: {e}")
|
27 |
+
return "Error generating audio"
|
28 |
+
|
29 |
print(result)
|