Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
from pyannote.audio import Pipeline
|
|
|
3 |
|
4 |
-
# ืืืขื ืืช
|
5 |
-
|
|
|
|
|
|
|
6 |
|
7 |
# ืคืื ืงืฆืื ืืืืฆืืข ืืืืื ืืืืจืื
|
8 |
def diarize(audio_file):
|
@@ -19,7 +23,7 @@ def diarize(audio_file):
|
|
19 |
# ืืืืจืช ืืืฉืง Gradio
|
20 |
interface = gr.Interface(
|
21 |
fn=diarize,
|
22 |
-
inputs=gr.Audio(
|
23 |
outputs="json",
|
24 |
description="Upload an audio file to get speaker diarization (timestamps and speaker IDs only)."
|
25 |
)
|
|
|
1 |
import gradio as gr
|
2 |
from pyannote.audio import Pipeline
|
3 |
+
import os
|
4 |
|
5 |
+
# ืืืขื ืืช ื-Token ืืืขืจืืช ืืฉืชื ื ืืกืืืื
|
6 |
+
auth_token = os.getenv("HF_AUTH_TOKEN")
|
7 |
+
|
8 |
+
# ืืืขื ืืช ืืืืื ืฉื Pyannote ืืืืืื ืืืืจืื ืขื ื-Token
|
9 |
+
pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization", use_auth_token=auth_token)
|
10 |
|
11 |
# ืคืื ืงืฆืื ืืืืฆืืข ืืืืื ืืืืจืื
|
12 |
def diarize(audio_file):
|
|
|
23 |
# ืืืืจืช ืืืฉืง Gradio
|
24 |
interface = gr.Interface(
|
25 |
fn=diarize,
|
26 |
+
inputs=gr.Audio(type="filepath"), # ืฉืืืืฉ ืืคืจืืืจ ืืืชืืื ืฉื Gradio
|
27 |
outputs="json",
|
28 |
description="Upload an audio file to get speaker diarization (timestamps and speaker IDs only)."
|
29 |
)
|