Nitzantry1
commited on
Commit
โข
bb2cfda
1
Parent(s):
357116d
Update app.py
Browse files
app.py
CHANGED
@@ -9,12 +9,15 @@ pipeline = Pipeline.from_pretrained(
|
|
9 |
|
10 |
# ืคืื ืงืฆืื ืืขืืืื ืงืืืฅ ืืืืื
|
11 |
def diarize_audio(audio_path):
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
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(
|