Fine tuning Whisper for Speech Transcription

  Рет қаралды 13,010

Trelis Research

Trelis Research

Күн бұрын

Get Life-time access to the ADVANCED Transcription Repo:
- trelis.com/advanced-transcrip...
Video Resources:
- Dataset: huggingface.co/datasets/Treli...
- Slides: docs.google.com/presentation/...
- Simple Whisper Transcription Notebook: colab.research.google.com/dri...
- Basic fine-tuning notebook: colab.research.google.com/git...
- PEFT Example: colab.research.google.com/dri...
Other links:
➡️ Trelis Resources and Support: Trelis.com/About
Chapters
0:00 Fine-tuning speech-to-text models
0:17 Video Overview
1:39 How to transcribe KZbin videos with Whisper
7:39 How do transcription models work?
20:08 Fine-tuning Whisper with LoRA
43:32 Performance evaluation of fine-tuned Whisper
48:32 Final Tips

Пікірлер: 61
@SiD-hq2fo
@SiD-hq2fo 4 ай бұрын
I cant thanks enough for the quality content you are providing please continue to upload such video!!
@AbdennacerAyeb
@AbdennacerAyeb 4 ай бұрын
easy, simple, well organized. Thank you
@anasdavoodtk3160
@anasdavoodtk3160 4 ай бұрын
Great explanation. the drum story!. good work
@gautammandewalker8935
@gautammandewalker8935 2 ай бұрын
Great video! You are one of the best teachers I have ever heard.
@heski6847
@heski6847 5 ай бұрын
great, thx! I needed it.
@master2054
@master2054 4 ай бұрын
good job!!
@miblish5168
@miblish5168 4 ай бұрын
This video really saved my @$$. I had Whisper&CoLab running a few moinths ago, but it broke. Your video and notebooks showed me why, and taught me several new tricks! Keep it up please.
@scifithoughts3611
@scifithoughts3611 2 ай бұрын
@Trellis have you considered instead of fine tuning, use an LLM to correct the spelling of Whisper output? (Prompt it to fix “my strell” to “mistrell”, etc.)
@scifithoughts3611
@scifithoughts3611 2 ай бұрын
Or another alternative is to prompt Whisper with the context and correct spelling of its common transcript mistakes?
@dachuandu6539
@dachuandu6539 25 күн бұрын
best explanation ever
@onursarikaya1385
@onursarikaya1385 2 ай бұрын
Thank you! It's a great investment :)
@TrelisResearch
@TrelisResearch 2 ай бұрын
you're welcome
@m_tron99
@m_tron99 3 ай бұрын
Great video. Can you do one on using WhisperX for diarisation and timestamping?
@ASphoton_energy
@ASphoton_energy Күн бұрын
Thanks so much, great description but I'm a little confused. At 10'58'' when discussing the breakdown of the frequencies you point to the blue graph and say: "here you can see its just an amplitude graph". I'm confused, I thought the red graph in front of 'Time' would have been the amplitude graph?
@user-kr2ec9sd8u
@user-kr2ec9sd8u 4 ай бұрын
This video was very instructive, thanks! For my case, I need a model that recognize items on a list, it consists mainly of medical vocabullary, so a simple whisper model does not get them. Regarding the terms and their pronunciation I will record them in a later moment, but are they inserted in the "DatasetDict()" part of the code instead of Hugging Face's "common_voice"? Also, how is the taught model saved and used in a new project? Untill now I've only used a simple model = whisper.load_model("small") code line in my projects
@TrelisResearch
@TrelisResearch 4 ай бұрын
Your training data will need to be prepared and included into the huggingface dataset (like the new dataset I created). To re-use the model, it's easiest to push it to huggingface hub as I do here, and then you can load it back down by using the same loading code I used for the base model. Technically I think it's possible to convert back to the openai format as well and then load it using a code snippet like you did. See here: github.com/openai/whisper/discussions/830#discussioncomment-4652413
@seancarmody1506
@seancarmody1506 Ай бұрын
Loved the video, I'm wondering if it's possible to do something similar using a vision model. Say for example a resnet trained for a certain task. Do you think it would be possible to train an adapter to allow the llm to understand the resnet features? I watched your Llava training video but the concept seemed a little different than I expected
@TrelisResearch
@TrelisResearch Ай бұрын
I suppose the original resnet didn't include attention, so probably that would be a disadvantage to transformers used now. But yes, in principle you could attach a resnet to the inputs of an llm - but I think it would be done something like in my llava / idefics video.
@RustemShaimagambetov
@RustemShaimagambetov 5 ай бұрын
Great video! How much data(rows) do we need to train to get acceptable results? Is it enough 5-6 rows ??
@TrelisResearch
@TrelisResearch 4 ай бұрын
Yes, even 5-6 can be enough to add knowledge of a few new words. I only had 6 rows. Probably 12 or 18 would have been better here.
@LinkSF1
@LinkSF1 4 ай бұрын
Do you know if there’s a way to downsample the frequencies? Eg if I have a 24khz sample I want to downsample to 16khz, what would be the preferred way of doing this?
@TrelisResearch
@TrelisResearch 4 ай бұрын
Howdy! Actually you can check in this vid there's a part towards the middle where I show how to downsample
@user-yu8sp2np2x
@user-yu8sp2np2x 5 ай бұрын
Recently I faced a situation where I fine-tuned a model on a training set and it returns good results from the training set example or validation set examples but when I give an input which he has never seen then it tends to produce contextually irrelevant results. Could you suggest what one should do in such a case? One thing that we can do is to make our training dataset more extensive but other than else can we so something else?
@TrelisResearch
@TrelisResearch 4 ай бұрын
create a separate validation set using data that is not from your training or validation set (could just be wikitext) and measure the validation loss on that during training. If it is rising quickly, then you are overtraining and need to train for less epochs and/or lower learning rate
@mrsilver8151
@mrsilver8151 12 күн бұрын
thanks for your great work, is there any way to convert the finetuned model to run with faster whisper, or there is another way to fine tune for faster whisper ?
@TrelisResearch
@TrelisResearch 11 күн бұрын
yup - see here: github.com/SYSTRAN/faster-whisper/issues/248 opennmt.net/CTranslate2/python/ctranslate2.converters.TransformersConverter.html If you try it, could you let me know if that really gives a 4x speed up on a GPU?
@javadasoodeh
@javadasoodeh 19 күн бұрын
Thank you for your explanation. Imagine I’m gonna start training whisper on a low resource language. I don’t have the whole entire dataset at first to feed for training. If I do the same as you do, meaning correct the transcription and pair it with the voice, and finally give it to model for fine tuning. If I do these several times, the model doesn’t forget the pervious learning or wouldn’t overfit? By and large, I would like to create a pipeline to collect pair of voices with their manual transcriptions, and then fine tune the model each time. Could you guide me what do I need to do this in this way?
@TrelisResearch
@TrelisResearch 18 күн бұрын
to avoid forgetting and overfitting you should blend in about 5% of original/english type voice data into your new dataset.
@jetpro
@jetpro 3 ай бұрын
Do you know how to export it to ONNX and correctly use it in deployment? Helpful video!
@TrelisResearch
@TrelisResearch 3 ай бұрын
I haven't dug into that angle for ONNX but here's the guide for getting back from huggingface to whisper and probably you can go from there? github.com/openai/whisper/discussions/830#discussioncomment-4652413
@PierreDELOM
@PierreDELOM 4 ай бұрын
Very instructive videos. Next one with Diarization ?
@TrelisResearch
@TrelisResearch 4 ай бұрын
interesting idea, I'll add to my notes
@tariqyahia9039
@tariqyahia9039 3 ай бұрын
Question, does the training file have to be in vtt format? or can it be in .txt?
@TrelisResearch
@TrelisResearch 3 ай бұрын
has to have time stamps, so vtt (or srt and you can convert to vtt).
@nysoc
@nysoc 5 күн бұрын
Thanks for this amazing video. I am trying to tune whisper to understand slurred speech (e.g. cerebral palsy). Would a small data sample work for that scenario too. Thanks!
@TrelisResearch
@TrelisResearch 5 күн бұрын
Yes, I think so!
@Rems766
@Rems766 3 ай бұрын
I've trouble fine tuning the large-v3 model. When I am evalutating, the compute_metrics function do not call properly the tokenizer method and it do not work. Any idea why?
@TrelisResearch
@TrelisResearch 3 ай бұрын
hmm that's odd, I haven't trained the large myself, I assume you tried posting on the github repo? any joy there, feel free to share the link if you create an issue
@imranullah3097
@imranullah3097 4 ай бұрын
For low resource language how to train tokenizer and add and then fine tune whisper.?
@TrelisResearch
@TrelisResearch 4 ай бұрын
oooh, yeah low resource is going to be tough. Probably the approach depends on language and whether it has close languages. Ideally you want to start with a tokenizer and fine-tuned model for a close language. If you do need to train a tokenizer, you can check this vid out here: huggingface.co/learn/nlp-course/chapter6/2?fw=pt
@user-xd1ic9qk8d
@user-xd1ic9qk8d Ай бұрын
good job!! but I'm not finding the checkpoints folders
@TrelisResearch
@TrelisResearch Ай бұрын
They'll be generated when you run through the training . Also, you need to set save_dir output_dir to somewhere you want the files to be.
@AndrewBawitlung
@AndrewBawitlung 5 ай бұрын
can u compare it with XLS-R?
@TrelisResearch
@TrelisResearch 4 ай бұрын
thanks for the tip, will be a while before I get back to speech but I have noted that as a topic
@bryantgoh1888
@bryantgoh1888 9 күн бұрын
May i ask, why the PEFT example given is different from the one you used in the video?
@TrelisResearch
@TrelisResearch 9 күн бұрын
It’s a more generic example that I then adapted/integrated for this video
@imranullah3097
@imranullah3097 5 ай бұрын
Kindly make a video on the following. Hifi-gan with transformer Multi model (text+image)
@TrelisResearch
@TrelisResearch 4 ай бұрын
thanks, I'll add to my list. I was already planning on multi-modal some time. will take me a bit of time before getting to it
@simonsu-yz9vo
@simonsu-yz9vo 3 ай бұрын
is it possible to fine tuning for speech translation?
@TrelisResearch
@TrelisResearch 3 ай бұрын
yes, you just need to format the Q&A for that.
@AndrewBawitlung
@AndrewBawitlung 3 ай бұрын
What to do when my language is not in the whisper tokenizer?
@TrelisResearch
@TrelisResearch 3 ай бұрын
Probably imperfect, but maybe you could choose the closest language and then fine-tune from there.
@sumitjana7794
@sumitjana7794 3 ай бұрын
I have transcripted text in .srt format, can I train with it??
@TrelisResearch
@TrelisResearch 3 ай бұрын
Yes! And for this script you can just convert srt to vtt losslessly using an online tool.
@sumitjana7794
@sumitjana7794 3 ай бұрын
thanks a lot @@TrelisResearch
@_loong9906
@_loong9906 24 күн бұрын
Great video! But, in my checkpoints, there's no 'added_tokens.json' or 'config.json' and so on. what's happening to me. what did i miss?
@TrelisResearch
@TrelisResearch 23 күн бұрын
You mean you are running training but not finding those files in your saved checkpoints? whereas you see them in my video when I do the same?
@ivor1113
@ivor1113 20 күн бұрын
Can you share the code in ADVANCED-transcription?
@TrelisResearch
@TrelisResearch 20 күн бұрын
Howdy! Yes, the code is in the ADVANCED-transcription repo, which you can buy lifetime access to (incl. future updates). If you buy and something is missing, you can create an issue in the repo.
@matbeedotcom
@matbeedotcom 4 ай бұрын
Would a DPO method theoretically work for more effectively fine tuning whisper?
@TrelisResearch
@TrelisResearch 4 ай бұрын
yeah DPO could be good for general performance improvement. for adding sounds/words, standard finetuning is probably best (SFT).
Fine-tune Multi-modal LLaVA Vision and Language Models
51:06
Trelis Research
Рет қаралды 16 М.
Fine-tuning Whisper to learn my Chinese dialect (Teochew)
28:10
Efficient NLP
Рет қаралды 4,2 М.
Василиса наняла личного массажиста 😂 #shorts
00:22
Денис Кукояка
Рет қаралды 7 МЛН
Which one of them is cooler?😎 @potapova_blog
00:45
Filaretiki
Рет қаралды 10 МЛН
Super gymnastics 😍🫣
00:15
Lexa_Merin
Рет қаралды 100 МЛН
Fine tuning LLMs for Memorization
46:51
Trelis Research
Рет қаралды 8 М.
World’s Fastest Talking AI: Deepgram + Groq
11:45
Greg Kamradt (Data Indy)
Рет қаралды 35 М.
Top Ten Fine Tuning Tips
24:58
Trelis Research
Рет қаралды 1,5 М.
RAG from the Ground Up with Python and Ollama
15:32
Decoder
Рет қаралды 23 М.
Data Extraction with Large Language Models
55:44
Trelis Research
Рет қаралды 10 М.
Fine-tuning Large Language Models (LLMs) | w/ Example Code
28:18
Shaw Talebi
Рет қаралды 252 М.
"okay, but I want Llama 3 for my specific use case" - Here's how
24:20
Bluetooth Desert Eagle
0:27
ts blur
Рет қаралды 8 МЛН
Как работает автопилот на Lixiang L9 Max
0:34
Семен Ефимов
Рет қаралды 16 М.
iPhone 12 socket cleaning #fixit
0:30
Tamar DB (mt)
Рет қаралды 42 МЛН
📦Он вам не медведь! Обзор FlyingBear S1
18:26
i love you subscriber ♥️ #iphone #iphonefold #shortvideo
0:14
Si pamerR
Рет қаралды 3,5 МЛН