eloi-goncalves commited on
Commit
a439774
·
1 Parent(s): 5d673bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -2,7 +2,14 @@ import gradio as gr
2
  from transformers import pipeline
3
  import numpy as np
4
 
5
- transcriber = pipeline("automatic-speech-recognition", model="openai/whisper-base.en")
 
 
 
 
 
 
 
6
 
7
  def transcribe(stream, new_chunk):
8
  sr, y = new_chunk
 
2
  from transformers import pipeline
3
  import numpy as np
4
 
5
+ transcriber = pipeline("automatic-speech-recognition", model="openai/whisper-base.pt")
6
+
7
+ transcriber.model.config.forced_decoder_ids = (
8
+ transcriber.tokenizer.get_decoder_prompt_ids(
9
+ language="pt",
10
+ task="transcribe"
11
+ )
12
+ )
13
 
14
  def transcribe(stream, new_chunk):
15
  sr, y = new_chunk