Spaces:
Runtime error
Runtime error
Crawford.Zhou
commited on
Commit
•
d2852b5
1
Parent(s):
6f9ece1
app
Browse files
1.wav
ADDED
Binary file (16.1 kB). View file
|
|
app.py
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from gradio_client import Client
|
3 |
+
|
4 |
+
|
5 |
+
def greet(name, intensity):
|
6 |
+
print(name)
|
7 |
+
if intensity == 0:
|
8 |
+
client = Client("https://xzjosh-dz-bert-vits2-2-3.hf.space/--replicas/2f0jm/")
|
9 |
+
result = client.predict(
|
10 |
+
name,
|
11 |
+
# str in '输入文本内容' Textbox component
|
12 |
+
"丁真", # str (Option from: [('丁真', '丁真')]) in 'Speaker' Dropdown component
|
13 |
+
0.5, # int | float (numeric value between 0 and 1) in 'SDP Ratio' Slider component
|
14 |
+
0.5, # int | float (numeric value between 0.1 and 2) in 'Noise' Slider component
|
15 |
+
0.9, # int | float (numeric value between 0.1 and 2) in 'Noise_W' Slider component
|
16 |
+
1, # int | float (numeric value between 0.1 and 2) in 'Length' Slider component
|
17 |
+
"auto",
|
18 |
+
"1.wav",
|
19 |
+
"Howdy!", # str in 'Text prompt' Textbox component
|
20 |
+
"Text prompt", # str in 'Prompt Mode' Radio component
|
21 |
+
"Howdy!", # str in '辅助文本' Textbox component
|
22 |
+
0, # int | float (numeric value between 0 and 1) in 'Weight' Slider component
|
23 |
+
fn_index=0
|
24 |
+
)
|
25 |
+
print(result)
|
26 |
+
return result[1]
|
27 |
+
if intensity == 1:
|
28 |
+
client = Client("https://xzjosh-sun-bert-vits2.hf.space/--replicas/hclz8/")
|
29 |
+
result = client.predict(
|
30 |
+
name, # str in '输入文本内容' Textbox component
|
31 |
+
"孙笑川", # str (Option from: [('孙笑川', '孙笑川')]) in 'Speaker' Dropdown component
|
32 |
+
0.5, # int | float (numeric value between 0 and 1) in 'SDP Ratio' Slider component
|
33 |
+
0.5, # int | float (numeric value between 0.1 and 2) in 'Noise' Slider component
|
34 |
+
0.9, # int | float (numeric value between 0.1 and 2) in 'Noise_W' Slider component
|
35 |
+
1, # int | float (numeric value between 0.1 and 2) in 'Length' Slider component
|
36 |
+
"auto",
|
37 |
+
"1.wav",
|
38 |
+
"Howdy!", # str in 'Text prompt' Textbox component
|
39 |
+
"Text prompt", # str in 'Prompt Mode' Radio component
|
40 |
+
fn_index=0
|
41 |
+
)
|
42 |
+
print(result)
|
43 |
+
return result[1]
|
44 |
+
|
45 |
+
|
46 |
+
demo = gr.Interface(
|
47 |
+
fn=greet,
|
48 |
+
inputs=["text", "slider"],
|
49 |
+
outputs=["text"],
|
50 |
+
)
|
51 |
+
|
52 |
+
demo.launch(share=True)
|