Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,14 +9,10 @@ f5tts = F5TTS()
|
|
| 9 |
|
| 10 |
@spaces.GPU
|
| 11 |
def run_tts(ref_audio, ref_text, gen_text, remove_silence=False):
|
| 12 |
-
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as tmp_ref:
|
| 13 |
-
tmp_ref.write(ref_audio.read())
|
| 14 |
-
tmp_ref_path = tmp_ref.name
|
| 15 |
-
|
| 16 |
output_wav_path = tempfile.mktemp(suffix=".wav")
|
| 17 |
|
| 18 |
wav, sr, _ = f5tts.infer(
|
| 19 |
-
ref_file=
|
| 20 |
ref_text=ref_text,
|
| 21 |
gen_text=gen_text,
|
| 22 |
file_wave=output_wav_path,
|
|
@@ -28,7 +24,7 @@ def run_tts(ref_audio, ref_text, gen_text, remove_silence=False):
|
|
| 28 |
demo = gr.Interface(
|
| 29 |
fn=run_tts,
|
| 30 |
inputs=[
|
| 31 |
-
gr.Audio(label="Reference Audio", type="
|
| 32 |
gr.Textbox(label="Reference Text", placeholder="some call me nature, others call me mother nature."),
|
| 33 |
gr.Textbox(label="Generation Text", placeholder="I don't really care what you call me..."),
|
| 34 |
gr.Checkbox(label="Remove Silence from Output?", value=False)
|
|
|
|
| 9 |
|
| 10 |
@spaces.GPU
|
| 11 |
def run_tts(ref_audio, ref_text, gen_text, remove_silence=False):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
output_wav_path = tempfile.mktemp(suffix=".wav")
|
| 13 |
|
| 14 |
wav, sr, _ = f5tts.infer(
|
| 15 |
+
ref_file=ref_audio,
|
| 16 |
ref_text=ref_text,
|
| 17 |
gen_text=gen_text,
|
| 18 |
file_wave=output_wav_path,
|
|
|
|
| 24 |
demo = gr.Interface(
|
| 25 |
fn=run_tts,
|
| 26 |
inputs=[
|
| 27 |
+
gr.Audio(label="Reference Audio", type="filepath"),
|
| 28 |
gr.Textbox(label="Reference Text", placeholder="some call me nature, others call me mother nature."),
|
| 29 |
gr.Textbox(label="Generation Text", placeholder="I don't really care what you call me..."),
|
| 30 |
gr.Checkbox(label="Remove Silence from Output?", value=False)
|