Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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.
|
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):
|