Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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):
|