Nitzantry1 commited on
Commit
bb2cfda
โ€ข
1 Parent(s): 357116d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -9,12 +9,15 @@ pipeline = Pipeline.from_pretrained(
9
 
10
  # ืคื•ื ืงืฆื™ื” ืœืขื™ื‘ื•ื“ ืงื•ื‘ืฅ ืื•ื“ื™ื•
11
  def diarize_audio(audio_path):
12
- # ื‘ืฆืข ื—ืœื•ืงืช ื“ื•ื‘ืจื™ื ืขื pyannote
13
- diarization = pipeline(audio_path)
14
- results = []
15
- for turn, _, speaker in diarization.itertracks(yield_label=True):
16
- results.append(f"{turn.start:.1f}s - {turn.end:.1f}s: {speaker}")
17
- return "\n".join(results)
 
 
 
18
 
19
  # ื”ื’ื“ืจืช ืžืžืฉืง Gradio
20
  interface = gr.Interface(
 
9
 
10
  # ืคื•ื ืงืฆื™ื” ืœืขื™ื‘ื•ื“ ืงื•ื‘ืฅ ืื•ื“ื™ื•
11
  def diarize_audio(audio_path):
12
+ try:
13
+ # ื‘ืฆืข ื—ืœื•ืงืช ื“ื•ื‘ืจื™ื ืขื pyannote
14
+ diarization = pipeline(audio_path)
15
+ results = []
16
+ for turn, _, speaker in diarization.itertracks(yield_label=True):
17
+ results.append(f"{turn.start:.1f}s - {turn.end:.1f}s: {speaker}")
18
+ return "\n".join(results)
19
+ except Exception as e:
20
+ return f"Error processing audio: {str(e)}"
21
 
22
  # ื”ื’ื“ืจืช ืžืžืฉืง Gradio
23
  interface = gr.Interface(