Spaces:
Sleeping
Sleeping
Commit
·
861c9e0
1
Parent(s):
d941b9c
update
Browse files
app.py
CHANGED
@@ -296,9 +296,9 @@ with gr.Blocks() as demo:
|
|
296 |
|
297 |
rootpath = os.path.dirname(str(in_loc))
|
298 |
# delete the previous folder(s) of Stage1
|
299 |
-
|
300 |
-
for
|
301 |
-
utils.dataDelete(
|
302 |
# establish a new folder
|
303 |
stage1_id = uuid.uuid4().hex
|
304 |
os.mkdir(rootpath+"/"+stage1_id+"/")
|
@@ -799,9 +799,9 @@ with gr.Blocks() as demo:
|
|
799 |
def reset_run(in_data, samplerate, modelname):
|
800 |
rootpath = os.path.dirname(str(in_data))
|
801 |
# delete the previous folder(s) of Stage2
|
802 |
-
|
803 |
-
for
|
804 |
-
utils.dataDelete(
|
805 |
# establish a new folder
|
806 |
stage2_id = uuid.uuid4().hex
|
807 |
os.mkdir(rootpath+"/"+stage2_id+"/")
|
|
|
296 |
|
297 |
rootpath = os.path.dirname(str(in_loc))
|
298 |
# delete the previous folder(s) of Stage1
|
299 |
+
folders = [ f.path for f in os.scandir(rootpath) if f.is_dir()]
|
300 |
+
for folder in folders:
|
301 |
+
utils.dataDelete(folder)
|
302 |
# establish a new folder
|
303 |
stage1_id = uuid.uuid4().hex
|
304 |
os.mkdir(rootpath+"/"+stage1_id+"/")
|
|
|
799 |
def reset_run(in_data, samplerate, modelname):
|
800 |
rootpath = os.path.dirname(str(in_data))
|
801 |
# delete the previous folder(s) of Stage2
|
802 |
+
folders = [ f.path for f in os.scandir(rootpath) if f.is_dir()]
|
803 |
+
for folder in folders:
|
804 |
+
utils.dataDelete(folder)
|
805 |
# establish a new folder
|
806 |
stage2_id = uuid.uuid4().hex
|
807 |
os.mkdir(rootpath+"/"+stage2_id+"/")
|