versae commited on
Commit
3555ad9
1 Parent(s): 86bce7e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -8,12 +8,14 @@ from huggingface_hub import model_info
8
  MODEL_NAME = "NbAiLab/whisper-large-sme" #this always needs to stay in line 8 :D sorry for the hackiness
9
  lang = "fi"
10
 
 
11
  device = 0 if torch.cuda.is_available() else "cpu"
12
  pipe = pipeline(
13
  task="automatic-speech-recognition",
14
  model=MODEL_NAME,
15
  chunk_length_s=30,
16
  device=device,
 
17
  )
18
 
19
  pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language=lang, task="transcribe")
 
8
  MODEL_NAME = "NbAiLab/whisper-large-sme" #this always needs to stay in line 8 :D sorry for the hackiness
9
  lang = "fi"
10
 
11
+ auth_token = os.environ.get("AUTH_TOKEN") or True
12
  device = 0 if torch.cuda.is_available() else "cpu"
13
  pipe = pipeline(
14
  task="automatic-speech-recognition",
15
  model=MODEL_NAME,
16
  chunk_length_s=30,
17
  device=device,
18
+ use_auth_token=auth_token,
19
  )
20
 
21
  pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language=lang, task="transcribe")