Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import os, shutil
|
3 |
|
4 |
-
import subprocess, os
|
5 |
assets_folder = "assets"
|
6 |
if not os.path.exists(assets_folder):
|
7 |
os.makedirs(assets_folder)
|
@@ -19,7 +19,7 @@ for file, link in files.items():
|
|
19 |
try:
|
20 |
subprocess.run(['wget', link, '-O', file_path], check=True)
|
21 |
except subprocess.CalledProcessError as e:
|
22 |
-
print(f"Error downloading {file}: {e}")
|
23 |
|
24 |
def show_available(filepath):
|
25 |
return os.listdir(filepath)
|
@@ -39,7 +39,7 @@ def upload_file(file):
|
|
39 |
|
40 |
with gr.Blocks() as app:
|
41 |
with gr.Row():
|
42 |
-
dropbox = gr.
|
43 |
audio_picker = gr.Dropdown(label="",choices=show_available('audios'))
|
44 |
dropbox.upload(fn=upload_file, inputs=['dropbox'],outputs=['audio_picker'])
|
45 |
|
|
|
1 |
import gradio as gr
|
2 |
import os, shutil
|
3 |
|
4 |
+
'''import subprocess, os
|
5 |
assets_folder = "assets"
|
6 |
if not os.path.exists(assets_folder):
|
7 |
os.makedirs(assets_folder)
|
|
|
19 |
try:
|
20 |
subprocess.run(['wget', link, '-O', file_path], check=True)
|
21 |
except subprocess.CalledProcessError as e:
|
22 |
+
print(f"Error downloading {file}: {e}")'''
|
23 |
|
24 |
def show_available(filepath):
|
25 |
return os.listdir(filepath)
|
|
|
39 |
|
40 |
with gr.Blocks() as app:
|
41 |
with gr.Row():
|
42 |
+
dropbox = gr.File(label="Upload files")
|
43 |
audio_picker = gr.Dropdown(label="",choices=show_available('audios'))
|
44 |
dropbox.upload(fn=upload_file, inputs=['dropbox'],outputs=['audio_picker'])
|
45 |
|