Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -184,54 +184,58 @@ with gr.Blocks(title="Vevo Voice Conversion") as demo:
|
|
184 |
interactive=True
|
185 |
)
|
186 |
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
|
|
|
|
|
|
|
|
235 |
|
236 |
with gr.Row():
|
237 |
steps = gr.Slider(
|
@@ -249,16 +253,32 @@ with gr.Blocks(title="Vevo Voice Conversion") as demo:
|
|
249 |
# Handle visibility of components based on mode
|
250 |
def update_interface(mode):
|
251 |
is_tts = mode == "tts"
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
|
258 |
mode.change(
|
259 |
fn=update_interface,
|
260 |
inputs=[mode],
|
261 |
-
outputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
)
|
263 |
|
264 |
# Handle generation
|
|
|
184 |
interactive=True
|
185 |
)
|
186 |
|
187 |
+
# Audio inputs
|
188 |
+
content_audio = gr.Audio(
|
189 |
+
label="Source Audio",
|
190 |
+
type="filepath",
|
191 |
+
visible=True,
|
192 |
+
interactive=True
|
193 |
+
)
|
194 |
+
|
195 |
+
ref_style_audio = gr.Audio(
|
196 |
+
label="Reference Style Audio",
|
197 |
+
type="filepath",
|
198 |
+
visible=True,
|
199 |
+
interactive=True
|
200 |
+
)
|
201 |
+
|
202 |
+
ref_timbre_audio = gr.Audio(
|
203 |
+
label="Reference Timbre Audio",
|
204 |
+
type="filepath",
|
205 |
+
visible=True,
|
206 |
+
interactive=True
|
207 |
+
)
|
208 |
+
|
209 |
+
# Text inputs
|
210 |
+
src_text = gr.Textbox(
|
211 |
+
label="Source Text",
|
212 |
+
placeholder="Enter text for TTS mode",
|
213 |
+
visible=False,
|
214 |
+
interactive=True
|
215 |
+
)
|
216 |
+
|
217 |
+
ref_text = gr.Textbox(
|
218 |
+
label="Reference Style Text",
|
219 |
+
placeholder="Optional: Enter reference text",
|
220 |
+
visible=False,
|
221 |
+
interactive=True
|
222 |
+
)
|
223 |
+
|
224 |
+
src_language = gr.Dropdown(
|
225 |
+
choices=["en", "zh"],
|
226 |
+
value="en",
|
227 |
+
label="Source Language",
|
228 |
+
visible=False,
|
229 |
+
interactive=True
|
230 |
+
)
|
231 |
+
|
232 |
+
ref_language = gr.Dropdown(
|
233 |
+
choices=["en", "zh"],
|
234 |
+
value="en",
|
235 |
+
label="Reference Language",
|
236 |
+
visible=False,
|
237 |
+
interactive=True
|
238 |
+
)
|
239 |
|
240 |
with gr.Row():
|
241 |
steps = gr.Slider(
|
|
|
253 |
# Handle visibility of components based on mode
|
254 |
def update_interface(mode):
|
255 |
is_tts = mode == "tts"
|
256 |
+
is_timbre = mode == "timbre"
|
257 |
+
|
258 |
+
return [
|
259 |
+
# Audio components visibility
|
260 |
+
not is_tts, # content_audio
|
261 |
+
not is_timbre and not is_tts, # ref_style_audio
|
262 |
+
True, # ref_timbre_audio (always visible)
|
263 |
+
# Text components visibility
|
264 |
+
is_tts, # src_text
|
265 |
+
is_tts, # ref_text
|
266 |
+
is_tts, # src_language
|
267 |
+
is_tts # ref_language
|
268 |
+
]
|
269 |
|
270 |
mode.change(
|
271 |
fn=update_interface,
|
272 |
inputs=[mode],
|
273 |
+
outputs=[
|
274 |
+
content_audio,
|
275 |
+
ref_style_audio,
|
276 |
+
ref_timbre_audio,
|
277 |
+
src_text,
|
278 |
+
ref_text,
|
279 |
+
src_language,
|
280 |
+
ref_language
|
281 |
+
]
|
282 |
)
|
283 |
|
284 |
# Handle generation
|