fahadqazi commited on
Commit
88b65df
·
verified ·
1 Parent(s): 5769a4f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -8,8 +8,10 @@ import torch
8
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
9
 
10
 
11
- auth_token = os.environ.get("hf_token") or True
12
-
 
 
13
  pipe = pipeline(model="fahadqazi/whisper-small-sindhi", device=device, use_auth_token=auth_token) # change to "your-username/the-name-you-picked"
14
 
15
  def transcribe(audio):
 
8
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
9
 
10
 
11
+ auth_token = os.getenv("hf_token")
12
+ if not auth_token:
13
+ raise ValueError("Hugging Face token is missing! Add it as a secret.")
14
+
15
  pipe = pipeline(model="fahadqazi/whisper-small-sindhi", device=device, use_auth_token=auth_token) # change to "your-username/the-name-you-picked"
16
 
17
  def transcribe(audio):