Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,8 +4,13 @@ from transformers import pipeline, WhisperProcessor, WhisperForConditionalGenera
|
|
| 4 |
from huggingface_hub import login
|
| 5 |
import os
|
| 6 |
|
| 7 |
-
#
|
| 8 |
hf_api_token = os.getenv("HF_API_TOKEN")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
login(token=hf_api_token, add_to_git_credential=True)
|
| 10 |
|
| 11 |
# Initialize the Whisper processor and model
|
|
|
|
| 4 |
from huggingface_hub import login
|
| 5 |
import os
|
| 6 |
|
| 7 |
+
# Retrieve the token from the environment variable
|
| 8 |
hf_api_token = os.getenv("HF_API_TOKEN")
|
| 9 |
+
|
| 10 |
+
if hf_api_token is None:
|
| 11 |
+
raise ValueError("HF_API_TOKEN environment variable is not set")
|
| 12 |
+
|
| 13 |
+
# Authenticate with Hugging Face
|
| 14 |
login(token=hf_api_token, add_to_git_credential=True)
|
| 15 |
|
| 16 |
# Initialize the Whisper processor and model
|