Spaces:
Running
on
Zero
Running
on
Zero
Hecheng0625
commited on
Commit
•
b928a8b
1
Parent(s):
4a33f76
Update app.py
Browse files
app.py
CHANGED
@@ -122,7 +122,7 @@ def text2semantic(
|
|
122 |
|
123 |
target_phone_id = g2p_(target_text, target_language)[1]
|
124 |
|
125 |
-
if target_len
|
126 |
target_len = int(
|
127 |
(len(prompt_speech) * len(target_phone_id) / len(prompt_phone_id))
|
128 |
/ 16000
|
@@ -276,7 +276,7 @@ def maskgct_inference(
|
|
276 |
n_timesteps_s2a=[25, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
277 |
cfg_s2a=2.5,
|
278 |
rescale_cfg_s2a=0.75,
|
279 |
-
device=torch.device("cuda:
|
280 |
):
|
281 |
speech_16k = librosa.load(prompt_speech_path, sr=16000)[0]
|
282 |
speech = librosa.load(prompt_speech_path, sr=24000)[0]
|
@@ -355,7 +355,7 @@ iface = gr.Interface(
|
|
355 |
gr.Textbox(label="Prompt Text"),
|
356 |
gr.Textbox(label="Target Text"),
|
357 |
gr.Number(
|
358 |
-
label="Target Duration (in seconds)", value
|
359 |
), # Removed 'optional=True'
|
360 |
gr.Slider(
|
361 |
label="Number of Timesteps", minimum=15, maximum=100, value=25, step=1
|
|
|
122 |
|
123 |
target_phone_id = g2p_(target_text, target_language)[1]
|
124 |
|
125 |
+
if target_len < 0:
|
126 |
target_len = int(
|
127 |
(len(prompt_speech) * len(target_phone_id) / len(prompt_phone_id))
|
128 |
/ 16000
|
|
|
276 |
n_timesteps_s2a=[25, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
277 |
cfg_s2a=2.5,
|
278 |
rescale_cfg_s2a=0.75,
|
279 |
+
device=torch.device("cuda:0"),
|
280 |
):
|
281 |
speech_16k = librosa.load(prompt_speech_path, sr=16000)[0]
|
282 |
speech = librosa.load(prompt_speech_path, sr=24000)[0]
|
|
|
355 |
gr.Textbox(label="Prompt Text"),
|
356 |
gr.Textbox(label="Target Text"),
|
357 |
gr.Number(
|
358 |
+
label="Target Duration (in seconds)", value=-1
|
359 |
), # Removed 'optional=True'
|
360 |
gr.Slider(
|
361 |
label="Number of Timesteps", minimum=15, maximum=100, value=25, step=1
|