versae commited on
Commit
602514f
·
verified ·
1 Parent(s): 769dbd6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -25,7 +25,12 @@ def pipe(file, return_timestamps=False):
25
  device=device,
26
  token=auth_token,
27
  )
28
- asr.model.config.forced_decoder_ids = asr.tokenizer.get_decoder_prompt_ids(language=lang, task="transcribe")
 
 
 
 
 
29
  return asr(file, return_timestamps=return_timestamps)
30
 
31
  def transcribe(file, return_timestamps=False):
 
25
  device=device,
26
  token=auth_token,
27
  )
28
+ asr.model.config.forced_decoder_ids = asr.tokenizer.get_decoder_prompt_ids(
29
+ language=lang,
30
+ task="transcribe",
31
+ no_timestamps=not return_timestamps,
32
+ )
33
+ asr.model.config.no_timestamps_token_id = tokenizer.encode("<|notimestamps|>", add_special_tokens=False)[0]
34
  return asr(file, return_timestamps=return_timestamps)
35
 
36
  def transcribe(file, return_timestamps=False):