wetdog commited on
Commit
bd82412
·
verified ·
1 Parent(s): 5bcf187

add token for gated and private models

Browse files
Files changed (1) hide show
  1. whisper.py +3 -2
whisper.py CHANGED
@@ -17,7 +17,7 @@ CKPT = "projecte-aina/whisper-large-v3-tiny-caesar"
17
  BATCH_SIZE = 1
18
  model = WhisperForConditionalGeneration.from_pretrained(MODEL_NAME, torch_dtype=torch_dtype).to(device)
19
  processor = WhisperProcessor.from_pretrained(MODEL_NAME)
20
- pipeline_vad = Pipeline.from_pretrained("pyannote/voice-activity-detection", use_auth_token=os.environ.get("HF_TOKEN"))
21
  threshold = 10000
22
  segments_dir = "."
23
 
@@ -25,7 +25,8 @@ pipe = pipeline(
25
  task="automatic-speech-recognition",
26
  model=CKPT,
27
  chunk_length_s=30,
28
- device=device
 
29
  )
30
 
31
  def post_process_transcription(example_transcription, max_repeats=1):
 
17
  BATCH_SIZE = 1
18
  model = WhisperForConditionalGeneration.from_pretrained(MODEL_NAME, torch_dtype=torch_dtype).to(device)
19
  processor = WhisperProcessor.from_pretrained(MODEL_NAME)
20
+ pipeline_vad = Pipeline.from_pretrained("pyannote/voice-activity-detection", use_auth_token=os.getenv("HF_TOKEN"))
21
  threshold = 10000
22
  segments_dir = "."
23
 
 
25
  task="automatic-speech-recognition",
26
  model=CKPT,
27
  chunk_length_s=30,
28
+ device=device,
29
+ use_auth_token=os.getenv("HF_TOKEN")
30
  )
31
 
32
  def post_process_transcription(example_transcription, max_repeats=1):