liuyang commited on
Commit
abc1edf
·
1 Parent(s): c97acaf
Files changed (1) hide show
  1. app.py +8 -7
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 and pre_meta["segments"]:
1058
- for chunk in pre_meta["segments"]:
1059
- if chunk.get("out_wav_path") and os.path.exists(chunk["out_wav_path"]):
1060
- try:
1061
- os.unlink(chunk["out_wav_path"])
1062
- except Exception:
1063
- pass
 
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):