Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -39,7 +39,11 @@ def return_prediction_w2v2_mic(mic=None, progress=gr.Progress(), device=device):
|
|
39 |
waveform = waveform[:60*sr]
|
40 |
w2v2_result = w2v2_classifier.classify_file_w2v2(waveform, device)
|
41 |
else:
|
42 |
-
|
|
|
|
|
|
|
|
|
43 |
|
44 |
recap_result = ""
|
45 |
prev_segment = ""
|
@@ -79,7 +83,11 @@ def return_prediction_w2v2_file(file=None, progress=gr.Progress(), device=device
|
|
79 |
w2v2_result = w2v2_classifier.classify_file_w2v2(waveform, device)
|
80 |
waveform = waveform[:60*sr]
|
81 |
else:
|
82 |
-
|
|
|
|
|
|
|
|
|
83 |
|
84 |
recap_result = ""
|
85 |
prev_segment = ""
|
|
|
39 |
waveform = waveform[:60*sr]
|
40 |
w2v2_result = w2v2_classifier.classify_file_w2v2(waveform, device)
|
41 |
else:
|
42 |
+
recap_result = " "
|
43 |
+
download_path = "empty.txt"
|
44 |
+
with open(download_path, "w") as f:
|
45 |
+
f.write(recap_result)
|
46 |
+
yield recap_result, download_path
|
47 |
|
48 |
recap_result = ""
|
49 |
prev_segment = ""
|
|
|
83 |
w2v2_result = w2v2_classifier.classify_file_w2v2(waveform, device)
|
84 |
waveform = waveform[:60*sr]
|
85 |
else:
|
86 |
+
recap_result = " "
|
87 |
+
download_path = "empty.txt"
|
88 |
+
with open(download_path, "w") as f:
|
89 |
+
f.write(recap_result)
|
90 |
+
yield recap_result, download_path
|
91 |
|
92 |
recap_result = ""
|
93 |
prev_segment = ""
|