Using fine tuned whisper model with whisper-timestamped #69
-
Hello! In the colab, I have this code: !pip3 install git+https://github.com/linto-ai/whisper-timestamped
!pip3 install matplotlib
!pip install transformers
!pip install torch
import whisper_timestamped
from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq
processor = AutoProcessor.from_pretrained("NbAiLab/whisper-large-v2-nob")
model = AutoModelForSpeechSeq2Seq.from_pretrained("NbAiLab/whisper-large-v2-nob")
import whisper_timestamped as whisper
import json
audio = whisper.load_audio("audio.mp3")
model = whisper.load_model(UNSURE_WHAT_TO_PUT_HERE, device="cuda")
result = whisper.transcribe(model, audio)
print(json.dumps(result, indent = 2, ensure_ascii = False)) I am not sure what to put in the model = whisper.load_model part, as highlighted by the capitalized text. Ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Oh, that's a really relevant suggestion: adding support for models finetuned by HuggingFace's transformers or SpeechBrain. I've just pushed something, adding things in Now you should be able to just do:
Note: for now, the |
Beta Was this translation helpful? Give feedback.
Oh, that's a really relevant suggestion: adding support for models finetuned by HuggingFace's transformers or SpeechBrain.
I've just pushed something, adding things in
whisper_timestamped.load_model
.Now you should be able to just do:
Note: for now, the
load_model
will work with HuggingFace repo and local folders as soon as they include the model size in their names ("tiny", "small", ..., "large-v2").