leo-kwan commited on
Commit
ad11d3d
1 Parent(s): efeef10

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -10,10 +10,10 @@ device = "cuda:0" if torch.cuda.is_available() else "cpu"
10
 
11
  # load speech translation checkpoint
12
  feature_extractor = WhisperFeatureExtractor.from_pretrained("openai/whisper-base")
13
- tokenizer = WhisperTokenizer.from_pretrained("openai/whisper-base", language="french", task="automatic-speech-recognition")
14
 
15
  model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-base")
16
- forced_decoder_ids = tokenizer.get_decoder_prompt_ids(language="french", task="automatic-speech-recognition")
17
  asr_pipe = pipeline(
18
  "automatic-speech-recognition",
19
  model=model,
 
10
 
11
  # load speech translation checkpoint
12
  feature_extractor = WhisperFeatureExtractor.from_pretrained("openai/whisper-base")
13
+ tokenizer = WhisperTokenizer.from_pretrained("openai/whisper-base", language="french", task="translate")
14
 
15
  model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-base")
16
+ forced_decoder_ids = tokenizer.get_decoder_prompt_ids(language="french", task="translate")
17
  asr_pipe = pipeline(
18
  "automatic-speech-recognition",
19
  model=model,