Update app.py
Browse files
app.py
CHANGED
@@ -30,24 +30,7 @@ with gr.Blocks(title="🔊",theme=gr.themes.Base(primary_hue="rose",neutral_hue=
|
|
30 |
with gr.Column():
|
31 |
with gr.Row():
|
32 |
dropbox = gr.Audio(label="your audio here.")
|
33 |
-
|
34 |
-
input_audio0 = gr.Dropdown(
|
35 |
-
label="Input Path",
|
36 |
-
value=paths_for_files('audios')[0],
|
37 |
-
choices=paths_for_files('audios'), # Only show absolute paths for audio files ending in .mp3, .wav, .flac or .ogg
|
38 |
-
allow_custom_value=True
|
39 |
-
)
|
40 |
-
with gr.Row():
|
41 |
-
audio_player = gr.Audio()
|
42 |
-
input_audio0.change(
|
43 |
-
inputs=[input_audio0],
|
44 |
-
outputs=[audio_player],
|
45 |
-
fn=lambda path: {"value":path,"__type__":"update"} if os.path.exists(path) else None
|
46 |
-
)
|
47 |
-
dropbox.upload(
|
48 |
-
fn=lambda audio:audio.name,
|
49 |
-
inputs=[dropbox],
|
50 |
-
outputs=[input_audio0])
|
51 |
with gr.Column():
|
52 |
with gr.Accordion("Change Index", open=False):
|
53 |
file_index2 = gr.Dropdown(
|
@@ -117,16 +100,7 @@ with gr.Blocks(title="🔊",theme=gr.themes.Base(primary_hue="rose",neutral_hue=
|
|
117 |
outputs=[voice_model, file_index2],
|
118 |
api_name="infer_refresh",
|
119 |
)
|
120 |
-
|
121 |
-
fn=lambda:{"choices":paths_for_files('audios'),"__type__":"update"}, #TODO check if properly returns a sorted list of audio files in the 'audios' folder that have the extensions '.wav', '.mp3', '.ogg', or '.flac'
|
122 |
-
inputs=[],
|
123 |
-
outputs = [input_audio0],
|
124 |
-
)
|
125 |
-
refresh_button.click(
|
126 |
-
fn=lambda:{"value":paths_for_files('audios')[0],"__type__":"update"} if len(paths_for_files('audios')) > 0 else {"value":"","__type__":"update"}, #TODO check if properly returns a sorted list of audio files in the 'audios' folder that have the extensions '.wav', '.mp3', '.ogg', or '.flac'
|
127 |
-
inputs=[],
|
128 |
-
outputs = [input_audio0],
|
129 |
-
)
|
130 |
with gr.Row():
|
131 |
f0_file = gr.File(label="F0 Path", visible=False)
|
132 |
with gr.Row():
|
|
|
30 |
with gr.Column():
|
31 |
with gr.Row():
|
32 |
dropbox = gr.Audio(label="your audio here.")
|
33 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
with gr.Column():
|
35 |
with gr.Accordion("Change Index", open=False):
|
36 |
file_index2 = gr.Dropdown(
|
|
|
100 |
outputs=[voice_model, file_index2],
|
101 |
api_name="infer_refresh",
|
102 |
)
|
103 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
with gr.Row():
|
105 |
f0_file = gr.File(label="F0 Path", visible=False)
|
106 |
with gr.Row():
|