Spaces:
Runtime error
Runtime error
Commit
·
fdcaaaa
1
Parent(s):
bacfdd0
Update app.py
Browse files
app.py
CHANGED
@@ -22,10 +22,10 @@ def load_and_fix_data(input_file, model_sampling_rate):
|
|
22 |
return speech
|
23 |
|
24 |
|
25 |
-
feature_extractor = AutoFeatureExtractor.from_pretrained("jonatasgrosman/wav2vec2-
|
26 |
sampling_rate = feature_extractor.sampling_rate
|
27 |
|
28 |
-
asr = pipeline("automatic-speech-recognition", model="jonatasgrosman/wav2vec2-
|
29 |
|
30 |
prefix = ''
|
31 |
model_checkpoint = "hackathon-pln-es/es_text_neutralizer"
|
@@ -116,7 +116,11 @@ def predict_and_ctc_lm_decode(input_file, speaker_idx: str=None):
|
|
116 |
synthesizer.save_wav(wavs, fp)
|
117 |
return fp.name
|
118 |
|
|
|
119 |
|
|
|
|
|
|
|
120 |
|
121 |
|
122 |
gr.Interface(
|
@@ -127,7 +131,7 @@ gr.Interface(
|
|
127 |
outputs=gr.outputs.Audio(label="Output"),
|
128 |
examples=[["Example1.wav"],["Example2.wav"],["Example3.wav"]],
|
129 |
title="Generate-Gender-Neutralized-Audios",
|
130 |
-
description =
|
131 |
#article="<p><center><img src='........e'></center></p>",
|
132 |
layout="horizontal",
|
133 |
theme="huggingface",
|
|
|
22 |
return speech
|
23 |
|
24 |
|
25 |
+
feature_extractor = AutoFeatureExtractor.from_pretrained("jonatasgrosman/wav2vec2-xls-r-1b-spanish")
|
26 |
sampling_rate = feature_extractor.sampling_rate
|
27 |
|
28 |
+
asr = pipeline("automatic-speech-recognition", model="jonatasgrosman/wav2vec2-xls-r-1b-spanish")
|
29 |
|
30 |
prefix = ''
|
31 |
model_checkpoint = "hackathon-pln-es/es_text_neutralizer"
|
|
|
116 |
synthesizer.save_wav(wavs, fp)
|
117 |
return fp.name
|
118 |
|
119 |
+
description = """This is a Gradio demo for generating gender-neutralized audios. To use it, simply provide an audio input (via microphone or audio recording), which will then be transcribed and gender-neutralized using pre-trained models. Finally, with the help of Coqui's TTS model, gender neutralized audio is generated.
|
120 |
|
121 |
+
> Pre-trained model used for Spanish ASR: [Please Click Here](https://huggingface.co/jonatasgrosman/wav2vec2-xls-r-1b-spanish)
|
122 |
+
>
|
123 |
+
"""
|
124 |
|
125 |
|
126 |
gr.Interface(
|
|
|
131 |
outputs=gr.outputs.Audio(label="Output"),
|
132 |
examples=[["Example1.wav"],["Example2.wav"],["Example3.wav"]],
|
133 |
title="Generate-Gender-Neutralized-Audios",
|
134 |
+
description = description,
|
135 |
#article="<p><center><img src='........e'></center></p>",
|
136 |
layout="horizontal",
|
137 |
theme="huggingface",
|