Spaces:
Running
Running
JacobLinCool
commited on
Commit
•
8fe2bf8
1
Parent(s):
015a5f1
Update app.py
Browse files
app.py
CHANGED
@@ -38,8 +38,8 @@ def preprocess(zip_file: str) -> str:
|
|
38 |
pp = PreProcess(48000, temp_dir, 3.0, False)
|
39 |
pp.pipeline_mp_inp_dir(data_dir, 4)
|
40 |
|
41 |
-
|
42 |
-
|
43 |
|
44 |
return temp_dir, f"Preprocessed {len(audio_files)} audio files.\n{log}"
|
45 |
|
@@ -52,14 +52,14 @@ def download_expdir(exp_dir: str) -> str:
|
|
52 |
@zero(duration=120)
|
53 |
def extract_features(exp_dir: str) -> str:
|
54 |
err = None
|
|
|
55 |
try:
|
56 |
-
fi = FeatureInput(exp_dir)
|
57 |
fi.run()
|
58 |
except Exception as e:
|
59 |
err = e
|
60 |
|
61 |
-
|
62 |
-
|
63 |
|
64 |
if err:
|
65 |
log = f"Error: {err}\n{log}"
|
|
|
38 |
pp = PreProcess(48000, temp_dir, 3.0, False)
|
39 |
pp.pipeline_mp_inp_dir(data_dir, 4)
|
40 |
|
41 |
+
pp.logfile.seek(0)
|
42 |
+
log = pp.logfile.read()
|
43 |
|
44 |
return temp_dir, f"Preprocessed {len(audio_files)} audio files.\n{log}"
|
45 |
|
|
|
52 |
@zero(duration=120)
|
53 |
def extract_features(exp_dir: str) -> str:
|
54 |
err = None
|
55 |
+
fi = FeatureInput(exp_dir)
|
56 |
try:
|
|
|
57 |
fi.run()
|
58 |
except Exception as e:
|
59 |
err = e
|
60 |
|
61 |
+
fi.logfile.seek(0)
|
62 |
+
log = fi.logfile.read()
|
63 |
|
64 |
if err:
|
65 |
log = f"Error: {err}\n{log}"
|