Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
# from transformers import WhisperProcessor, WhisperForConditionalGeneration
|
3 |
from datasets import load_dataset
|
4 |
-
from transformers import pipeline
|
5 |
|
6 |
import torch
|
7 |
# import librosa
|
@@ -14,7 +14,7 @@ import torch
|
|
14 |
model_id = "openai/whisper-large-v3-turbo"
|
15 |
|
16 |
models = AutoModelForSpeechSeq2Seq.from_pretrained(
|
17 |
-
model_id,
|
18 |
)
|
19 |
|
20 |
model = pipeline("automatic-speech-recognition", model=models, chunk_length_s=30, device=0)
|
|
|
1 |
import gradio as gr
|
2 |
# from transformers import WhisperProcessor, WhisperForConditionalGeneration
|
3 |
from datasets import load_dataset
|
4 |
+
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
|
5 |
|
6 |
import torch
|
7 |
# import librosa
|
|
|
14 |
model_id = "openai/whisper-large-v3-turbo"
|
15 |
|
16 |
models = AutoModelForSpeechSeq2Seq.from_pretrained(
|
17 |
+
model_id, low_cpu_mem_usage=True
|
18 |
)
|
19 |
|
20 |
model = pipeline("automatic-speech-recognition", model=models, chunk_length_s=30, device=0)
|