change authentification arg
Browse filesFaced exactly the same issue as described on [stackoverflow](https://stackoverflow.com/questions/78805545/error-downloading-pyannote-speaker-diarization-pipeline-despite-having-read-ac)
Trying to apply the solution
- handler.py +2 -1
handler.py
CHANGED
|
@@ -15,8 +15,9 @@ class EndpointHandler():
|
|
| 15 |
raise ValueError("Hugging Face authentication token (MY_KEY) is missing.")
|
| 16 |
|
| 17 |
# Initialize the pipeline with the authentication token
|
|
|
|
| 18 |
self.pipeline = Pipeline.from_pretrained(
|
| 19 |
-
"pyannote/speaker-diarization-3.1", use_auth_token=
|
| 20 |
)
|
| 21 |
|
| 22 |
# Move the pipeline to the appropriate device (CPU or GPU)
|
|
|
|
| 15 |
raise ValueError("Hugging Face authentication token (MY_KEY) is missing.")
|
| 16 |
|
| 17 |
# Initialize the pipeline with the authentication token
|
| 18 |
+
os.environ["HF_TOKEN"] = hf_token
|
| 19 |
self.pipeline = Pipeline.from_pretrained(
|
| 20 |
+
"pyannote/speaker-diarization-3.1", use_auth_token=True,
|
| 21 |
)
|
| 22 |
|
| 23 |
# Move the pipeline to the appropriate device (CPU or GPU)
|