Spaces:
Runtime error
Runtime error
Update voice_analysis.py
Browse files- voice_analysis.py +2 -2
voice_analysis.py
CHANGED
|
@@ -13,12 +13,12 @@ def extract_audio_from_video(video_path):
|
|
| 13 |
|
| 14 |
def diarize_speakers(audio_path):
|
| 15 |
# Load the token from the environment variable
|
| 16 |
-
hf_token = os.environ.get("
|
| 17 |
|
| 18 |
if not hf_token:
|
| 19 |
raise ValueError("HF_TOKEN environment variable is not set. Please add it in your Hugging Face Space's Variables and secrets section.")
|
| 20 |
|
| 21 |
-
pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization-3.1", use_auth_token=
|
| 22 |
diarization = pipeline(audio_path)
|
| 23 |
return diarization
|
| 24 |
|
|
|
|
| 13 |
|
| 14 |
def diarize_speakers(audio_path):
|
| 15 |
# Load the token from the environment variable
|
| 16 |
+
hf_token = os.environ.get("py_annote_hf_token")
|
| 17 |
|
| 18 |
if not hf_token:
|
| 19 |
raise ValueError("HF_TOKEN environment variable is not set. Please add it in your Hugging Face Space's Variables and secrets section.")
|
| 20 |
|
| 21 |
+
pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization-3.1", use_auth_token=hf_token)
|
| 22 |
diarization = pipeline(audio_path)
|
| 23 |
return diarization
|
| 24 |
|