fahadqazi commited on
Commit
29b1b8a
·
verified ·
1 Parent(s): cddfcf2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -1,5 +1,6 @@
1
  from transformers import pipeline
2
  import gradio as gr
 
3
  import torch
4
 
5
 
@@ -7,7 +8,9 @@ import torch
7
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
8
 
9
 
10
- pipe = pipeline(model="fahadqazi/whisper-small-sindhi", device=device) # change to "your-username/the-name-you-picked"
 
 
11
 
12
  def transcribe(audio):
13
  text = pipe(audio)["text"]
 
1
  from transformers import pipeline
2
  import gradio as gr
3
+ import os
4
  import torch
5
 
6
 
 
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):
16
  text = pipe(audio)["text"]