Commit
·
7a503a5
1
Parent(s):
a7d72e6
Update helpers.py
Browse files- helpers.py +4 -0
helpers.py
CHANGED
@@ -67,6 +67,10 @@ def update_model_dropdown(category):
|
|
67 |
return gr.Dropdown(choices=list(MODEL_CONFIGS[category].keys()), label="Model")
|
68 |
|
69 |
def handle_file_upload(uploaded_file, file_path, is_auto_ensemble=False):
|
|
|
|
|
|
|
|
|
70 |
if uploaded_file:
|
71 |
target_path = save_uploaded_file(uploaded_file, is_input=True)
|
72 |
return target_path, target_path
|
|
|
67 |
return gr.Dropdown(choices=list(MODEL_CONFIGS[category].keys()), label="Model")
|
68 |
|
69 |
def handle_file_upload(uploaded_file, file_path, is_auto_ensemble=False):
|
70 |
+
clear_temp_folder("/tmp", exclude_items=["gradio", "config.json"])
|
71 |
+
clear_directory(INPUT_DIR)
|
72 |
+
os.makedirs(INPUT_DIR, exist_ok=True)
|
73 |
+
clear_directory(INPUT_DIR)
|
74 |
if uploaded_file:
|
75 |
target_path = save_uploaded_file(uploaded_file, is_input=True)
|
76 |
return target_path, target_path
|