Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -231,7 +231,7 @@ def infer_batch(ref_audio, ref_text, gen_text_batches, exp_name, remove_silence,
|
|
231 |
ref_text = ref_text + " "
|
232 |
|
233 |
# Define weights for characters
|
234 |
-
punctuation_weights = {",":
|
235 |
|
236 |
for i, gen_text in enumerate(progress.tqdm(gen_text_batches)):
|
237 |
# Prepare the text
|
@@ -383,9 +383,9 @@ def infer(ref_audio_orig, ref_text, gen_text, exp_name, remove_silence, cross_fa
|
|
383 |
aseg = non_silent_wave
|
384 |
|
385 |
audio_duration = len(aseg)
|
386 |
-
if audio_duration >
|
387 |
-
gr.Warning("Audio is over 8s, clipping to only first
|
388 |
-
aseg = aseg[:
|
389 |
aseg.export(f.name, format="wav")
|
390 |
ref_audio = f.name
|
391 |
|
@@ -394,7 +394,7 @@ def infer(ref_audio_orig, ref_text, gen_text, exp_name, remove_silence, cross_fa
|
|
394 |
|
395 |
ref_text = pipe(
|
396 |
ref_audio,
|
397 |
-
chunk_length_s=
|
398 |
batch_size=128,
|
399 |
generate_kwargs={"task": "transcribe"# ,"language": language_code # Use the variable here
|
400 |
},
|
|
|
231 |
ref_text = ref_text + " "
|
232 |
|
233 |
# Define weights for characters
|
234 |
+
punctuation_weights = {",": 2, ".": 3, " ": 1} # Add more punctuation as needed
|
235 |
|
236 |
for i, gen_text in enumerate(progress.tqdm(gen_text_batches)):
|
237 |
# Prepare the text
|
|
|
383 |
aseg = non_silent_wave
|
384 |
|
385 |
audio_duration = len(aseg)
|
386 |
+
if audio_duration > 7500:
|
387 |
+
gr.Warning("Audio is over 8s, clipping to only first 8s.")
|
388 |
+
aseg = aseg[:7500]
|
389 |
aseg.export(f.name, format="wav")
|
390 |
ref_audio = f.name
|
391 |
|
|
|
394 |
|
395 |
ref_text = pipe(
|
396 |
ref_audio,
|
397 |
+
chunk_length_s=15,
|
398 |
batch_size=128,
|
399 |
generate_kwargs={"task": "transcribe"# ,"language": language_code # Use the variable here
|
400 |
},
|