Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import torch
|
|
| 6 |
import gradio as gr
|
| 7 |
import pytube as pt
|
| 8 |
import spaces
|
| 9 |
-
from transformers import WhisperForConditionalGeneration, WhisperProcessor, pipeline
|
| 10 |
from huggingface_hub import model_info
|
| 11 |
try:
|
| 12 |
import flash_attn
|
|
@@ -33,6 +33,7 @@ def pipe(file, return_timestamps=False):
|
|
| 33 |
asr = pipeline(
|
| 34 |
task="automatic-speech-recognition",
|
| 35 |
model=model,
|
|
|
|
| 36 |
chunk_length_s=30,
|
| 37 |
device=device,
|
| 38 |
token=auth_token,
|
|
|
|
| 6 |
import gradio as gr
|
| 7 |
import pytube as pt
|
| 8 |
import spaces
|
| 9 |
+
from transformers import AutoTokenizer, WhisperForConditionalGeneration, WhisperProcessor, pipeline
|
| 10 |
from huggingface_hub import model_info
|
| 11 |
try:
|
| 12 |
import flash_attn
|
|
|
|
| 33 |
asr = pipeline(
|
| 34 |
task="automatic-speech-recognition",
|
| 35 |
model=model,
|
| 36 |
+
tokenizer=AutoTokenizer.from_pretrained(MODEL_NAME),
|
| 37 |
chunk_length_s=30,
|
| 38 |
device=device,
|
| 39 |
token=auth_token,
|