Spaces:
Runtime error
Runtime error
liuyang
commited on
Commit
·
abc1edf
1
Parent(s):
c97acaf
clean up
Browse files
app.py
CHANGED
|
@@ -1054,13 +1054,14 @@ class WhisperTranscriber:
|
|
| 1054 |
return {"error": f"Processing failed: {str(e)}"}
|
| 1055 |
finally:
|
| 1056 |
# Clean up preprocessed wav
|
| 1057 |
-
if pre_meta
|
| 1058 |
-
for
|
| 1059 |
-
|
| 1060 |
-
|
| 1061 |
-
|
| 1062 |
-
|
| 1063 |
-
|
|
|
|
| 1064 |
|
| 1065 |
@spaces.GPU # each call gets a GPU slice
|
| 1066 |
def process_audio_diarization(self, task_json, num_speakers=0):
|
|
|
|
| 1054 |
return {"error": f"Processing failed: {str(e)}"}
|
| 1055 |
finally:
|
| 1056 |
# Clean up preprocessed wav
|
| 1057 |
+
if pre_meta:
|
| 1058 |
+
for pre_meta in pre_metas:
|
| 1059 |
+
for chunk in pre_meta["segments"]:
|
| 1060 |
+
if chunk.get("out_wav_path") and os.path.exists(chunk["out_wav_path"]):
|
| 1061 |
+
try:
|
| 1062 |
+
os.unlink(chunk["out_wav_path"])
|
| 1063 |
+
except Exception:
|
| 1064 |
+
pass
|
| 1065 |
|
| 1066 |
@spaces.GPU # each call gets a GPU slice
|
| 1067 |
def process_audio_diarization(self, task_json, num_speakers=0):
|