Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,9 @@ import shutil
|
|
6 |
import numpy as np
|
7 |
from scipy.io import wavfile
|
8 |
from pydub import AudioSegment
|
|
|
|
|
|
|
9 |
"""
|
10 |
model_ids = [
|
11 |
'suno/bark',
|
@@ -176,12 +179,20 @@ with gr.Blocks(css=css) as demo:
|
|
176 |
prompt = gr.Textbox(
|
177 |
label="Text to speech prompt"
|
178 |
)
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
|
186 |
submit_btn = gr.Button("Submit")
|
187 |
|
|
|
6 |
import numpy as np
|
7 |
from scipy.io import wavfile
|
8 |
from pydub import AudioSegment
|
9 |
+
|
10 |
+
file_upload_available = os.environ.get("ALLOW_FILE_UPLOAD")
|
11 |
+
|
12 |
"""
|
13 |
model_ids = [
|
14 |
'suno/bark',
|
|
|
179 |
prompt = gr.Textbox(
|
180 |
label="Text to speech prompt"
|
181 |
)
|
182 |
+
|
183 |
+
if file_upload_available is True:
|
184 |
+
audio_in = gr.Audio(
|
185 |
+
label="WAV voice to clone",
|
186 |
+
type="filepath",
|
187 |
+
source="upload"
|
188 |
+
)
|
189 |
+
else:
|
190 |
+
audio_in = gr.Audio(
|
191 |
+
label="WAV voice to clone",
|
192 |
+
type="filepath",
|
193 |
+
source="upload",
|
194 |
+
interactive = False
|
195 |
+
)
|
196 |
|
197 |
submit_btn = gr.Button("Submit")
|
198 |
|