Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
examples
Browse files
app.py
CHANGED
|
@@ -67,13 +67,12 @@ def load_model():
|
|
| 67 |
print('Failed to load voice model!')
|
| 68 |
return
|
| 69 |
|
| 70 |
-
def predict(
|
| 71 |
|
| 72 |
# reload model just in case
|
| 73 |
load_model()
|
| 74 |
|
| 75 |
model_type = 'xVAPitch'
|
| 76 |
-
line = 'Test'
|
| 77 |
pace = pacing if pacing else 1.0
|
| 78 |
save_path = '/tmp/xvapitch_audio_sample.wav'
|
| 79 |
language = 'en'
|
|
@@ -84,7 +83,8 @@ def predict(input, pacing):
|
|
| 84 |
data = {
|
| 85 |
'pluginsContext': '{}',
|
| 86 |
'modelType': model_type,
|
| 87 |
-
|
|
|
|
| 88 |
'pace': pace,
|
| 89 |
'outfile': save_path,
|
| 90 |
'vocoder': 'n/a',
|
|
@@ -120,6 +120,13 @@ gradio_app = gr.Interface(
|
|
| 120 |
],
|
| 121 |
outputs=gr.Audio(label="22kHz audio", type="filepath"),
|
| 122 |
title="xVASynth (WIP)",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
)
|
| 124 |
|
| 125 |
|
|
|
|
| 67 |
print('Failed to load voice model!')
|
| 68 |
return
|
| 69 |
|
| 70 |
+
def predict(input_text, pacing):
|
| 71 |
|
| 72 |
# reload model just in case
|
| 73 |
load_model()
|
| 74 |
|
| 75 |
model_type = 'xVAPitch'
|
|
|
|
| 76 |
pace = pacing if pacing else 1.0
|
| 77 |
save_path = '/tmp/xvapitch_audio_sample.wav'
|
| 78 |
language = 'en'
|
|
|
|
| 83 |
data = {
|
| 84 |
'pluginsContext': '{}',
|
| 85 |
'modelType': model_type,
|
| 86 |
+
# pad with whitespaces as a workaround to avoid cutoffs
|
| 87 |
+
'sequence': input_text.center(len(input_text) + 2, ' '),
|
| 88 |
'pace': pace,
|
| 89 |
'outfile': save_path,
|
| 90 |
'vocoder': 'n/a',
|
|
|
|
| 120 |
],
|
| 121 |
outputs=gr.Audio(label="22kHz audio", type="filepath"),
|
| 122 |
title="xVASynth (WIP)",
|
| 123 |
+
examples=[
|
| 124 |
+
["Once, I headed in much deeper. But I doubt I'll ever do that again.", 1],
|
| 125 |
+
["You love hurting me, huh?", 1.5],
|
| 126 |
+
["Ah! What is happening to me?!?", 1],
|
| 127 |
+
["Embrace your demise!", 1],
|
| 128 |
+
["Never come back!", 1]
|
| 129 |
+
]
|
| 130 |
)
|
| 131 |
|
| 132 |
|