Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -61,7 +61,7 @@ print(f"Using device: {device}, dtype: {dtype}")
|
|
61 |
pipe = pipeline(
|
62 |
"automatic-speech-recognition",
|
63 |
model="openai/whisper-large-v3-turbo",
|
64 |
-
torch_dtype=
|
65 |
device=device,
|
66 |
)
|
67 |
#vocos = Vocos.from_pretrained("charactr/vocos-mel-24khz")
|
@@ -344,7 +344,7 @@ def infer(ref_audio_orig, ref_text, gen_text, exp_name, remove_silence, cross_fa
|
|
344 |
audio, sr = torchaudio.load(ref_audio)
|
345 |
|
346 |
# Use the new chunk_text function to split gen_text
|
347 |
-
max_chars = int(len(ref_text.encode('utf-8')) / (audio.shape[-1] / sr) * (
|
348 |
gen_text_batches = chunk_text(gen_text, max_chars=135)
|
349 |
print('ref_text', ref_text)
|
350 |
for i, batch_text in enumerate(gen_text_batches):
|
|
|
61 |
pipe = pipeline(
|
62 |
"automatic-speech-recognition",
|
63 |
model="openai/whisper-large-v3-turbo",
|
64 |
+
torch_dtype=dtype,
|
65 |
device=device,
|
66 |
)
|
67 |
#vocos = Vocos.from_pretrained("charactr/vocos-mel-24khz")
|
|
|
344 |
audio, sr = torchaudio.load(ref_audio)
|
345 |
|
346 |
# Use the new chunk_text function to split gen_text
|
347 |
+
max_chars = int(len(ref_text.encode('utf-8')) / (audio.shape[-1] / sr) * (25 - audio.shape[-1] / sr))
|
348 |
gen_text_batches = chunk_text(gen_text, max_chars=135)
|
349 |
print('ref_text', ref_text)
|
350 |
for i, batch_text in enumerate(gen_text_batches):
|