Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -37,7 +37,7 @@ pipe = pipeline(
|
|
37 |
|
38 |
pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language=lang, task="transcribe")
|
39 |
|
40 |
-
|
41 |
|
42 |
def transcribe_audio(audio_file):
|
43 |
if audio_file.endswith(".m4a"):
|
@@ -46,15 +46,7 @@ def transcribe_audio(audio_file):
|
|
46 |
start_time = time.time()
|
47 |
|
48 |
with torch.no_grad():
|
49 |
-
output = pipe(
|
50 |
-
audio_file,
|
51 |
-
chunk_length_s=30,
|
52 |
-
generate_kwargs={
|
53 |
-
# "task": task,
|
54 |
-
"pad_token_id": processor.tokenizer.pad_token_id,
|
55 |
-
"eos_token_id": processor.tokenizer.eos_token_id
|
56 |
-
}
|
57 |
-
)
|
58 |
|
59 |
text = output["text"]
|
60 |
end_time = time.time()
|
|
|
37 |
|
38 |
pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language=lang, task="transcribe")
|
39 |
|
40 |
+
|
41 |
|
42 |
def transcribe_audio(audio_file):
|
43 |
if audio_file.endswith(".m4a"):
|
|
|
46 |
start_time = time.time()
|
47 |
|
48 |
with torch.no_grad():
|
49 |
+
output = pipe(audio_file)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
text = output["text"]
|
52 |
end_time = time.time()
|