Spaces:
Sleeping
Sleeping
Update gradio interface
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ import librosa
|
|
| 14 |
from pvq_manipulation.helper.vad import EnergyVAD
|
| 15 |
import gradio as gr
|
| 16 |
|
| 17 |
-
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 18 |
|
| 19 |
# load tts model
|
| 20 |
storage_dir_tts = Path("./models/tts_model/")
|
|
@@ -164,12 +164,13 @@ def update_manipulation(manipulation_idx, manipulation_fkt):
|
|
| 164 |
|
| 165 |
dropdown_options = [(label, i) for i, label in enumerate(label_options)]
|
| 166 |
demo = gr.Interface(
|
| 167 |
-
|
|
|
|
| 168 |
inputs=[
|
| 169 |
-
gr.Dropdown(dropdown_options, value=2, type="index"),
|
| 170 |
-
gr.Slider(minimum=-2.0, maximum=2.0, value=1.0, step=0.1),
|
| 171 |
],
|
| 172 |
-
outputs=[gr.Audio(label="original"), gr.Audio(label="manipulated")],
|
| 173 |
)
|
| 174 |
|
| 175 |
if __name__ == "__main__":
|
|
|
|
| 14 |
from pvq_manipulation.helper.vad import EnergyVAD
|
| 15 |
import gradio as gr
|
| 16 |
|
| 17 |
+
device = 'cpu' #'cuda' if torch.cuda.is_available() else 'cpu'
|
| 18 |
|
| 19 |
# load tts model
|
| 20 |
storage_dir_tts = Path("./models/tts_model/")
|
|
|
|
| 164 |
|
| 165 |
dropdown_options = [(label, i) for i, label in enumerate(label_options)]
|
| 166 |
demo = gr.Interface(
|
| 167 |
+
title="Perceptual Voice Quality (PVQ) Manipulation",
|
| 168 |
+
fn=update_manipulation,
|
| 169 |
inputs=[
|
| 170 |
+
gr.Dropdown(label="PVQ Feature", choices=dropdown_options, value=2, type="index"),
|
| 171 |
+
gr.Slider(label="Manipulation Factor", minimum=-2.0, maximum=2.0, value=1.0, step=0.1),
|
| 172 |
],
|
| 173 |
+
outputs=[gr.Audio(label="original utterance"), gr.Audio(label="manipulated utterance")],
|
| 174 |
)
|
| 175 |
|
| 176 |
if __name__ == "__main__":
|