DeepLearningExamples
DeepLearningExamples copied to clipboard
Can we fine tune a fine tuned model for quartznet architecture?
Hello , is there any pre-trained models for the french language? or Is there any possible way to fine-tune a fine-tuned model the second time?
thanks,
Hi @wiamfa
there is a pre-trained model for French from the NeMo project.
You can use it in NeMo, or follow these steps to load it in DeepLearningExamples:
- Change the extension from
.nemo
to.tar.gz
. - After unpacking you'll find two files:
model_weights.ckpt
andmodel_config.yaml
. - Make a copy of
configs/quartznet15x5_speedp-online-1.15_speca.yaml
and replacelabels
with those frommodel_config.yaml
. - Rename the keys in
model_weights.ckpt
:
import torch
remap = lambda k: (k.replace('encoder.encoder', 'encoder.layers')
.replace('decoder.decoder_layers', 'decoder.layers')
.replace('conv.weight', 'weight'))
ckpt = torch.load('model_weights.ckpt')
torch.save({'state_dict': {remap(k): v for k, v in ckpt.items() if 'preproc' not in k}},
'qn_15x5_french.pt')
Voilà!
Is there any possible way to fine-tune a fine-tuned model the second time?
This should work fine too.