raygiles3 commited on
Commit
bb7420f
·
verified ·
1 Parent(s): 01e9eb0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -4,8 +4,13 @@ from transformers import pipeline, WhisperProcessor, WhisperForConditionalGenera
4
  from huggingface_hub import login
5
  import os
6
 
7
- # Authenticate with Hugging Face
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