First I finetuned basic model omniASR_LLM_1B_v2 like this:
cd /path/to/omnilingual-asr
CUDA_VISIBLE_DEVICES=2,3,4 torchrun --nproc_per_node=3 \
-m workflows.recipes.wav2vec2.asr $OUTPUT_DIR \
--config-file $CONFIG_HOME/my-llm-finetune.yaml
After that I get checkpoints located in path/to/checkpoints, like step_800/model/pp_00/tp_00 contains sdp_00.pt, sdp_01.pt and sdp_02.pt.
Now I want to start a new round of finetuning based on a certain checkpoint, rather than the original model like omniASR_LLM_1B_v2. So I modifed the my-llm-finetune.yaml as below. I made 2 attempts, one adding model.path while the other adding pretrained_encoder.name/path/family/dtype.
model:
name: "omniASR_LLM_1B_v2"
path: /path/to/checkpoints/step_800/consolidated.pt
family: wav2vec2_llama
dtype: bfloat16 # float32 # bfloat16
pretrained_encoder:
# name: "LLM_1B_v2_800step-260113_1807"
# path: /path/to/checkpoints/step_800/consolidated.pt
# family: wav2vec2_llama
# dtype: bfloat16
mmap: true
Complete config.yaml: config-onlymodifiedmodel.yaml
However, I got error information:
WARNING fairseq2 - Both `model.name` and `model.path` are specified. `model.path` takes
precedence.
ERROR fairseq2 - Recipe failed due to an unexpected error. See logged stack trace for details
and file a bug report to the corresponding author.
Traceback (most recent call last):
File
"/root/anaconda3/envs/omnilingual/lib/python3.10/site-packages/fairseq2/recipe/internal/
model.py", line 212, in _load_custom_model
config = family.config_kls()
TypeError: Wav2Vec2LlamaConfig.__init__() missing 2 required keyword-only arguments:
'wav2vec2_asr_config' and 'llama_config'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
...
File
"/root/anaconda3/envs/omnilingual/lib/python3.10/site-packages/fairseq2/recipe/compositi
on/model.py", line 32, in get_model
return model_provider.get()
File
"/root/anaconda3/envs/omnilingual/lib/python3.10/site-packages/fairseq2/recipe/internal/
model.py", line 63, in get
model = self._bootstrapper.bootstrap()
File
"/root/anaconda3/envs/omnilingual/lib/python3.10/site-packages/fairseq2/recipe/internal/
model.py", line 111, in bootstrap
return self._load_custom_model()
File
"/root/anaconda3/envs/omnilingual/lib/python3.10/site-packages/fairseq2/recipe/internal/
model.py", line 214, in _load_custom_model
raise InternalError(
fairseq2.error.InternalError: Default configuration of the
<fairseq2.models.family.StandardModelFamily object at 0x7fb98bd02560> model family
cannot be constructed.
More details: rank_0.log
Maybe it's worth noting that I had successfully merged them into a single file step_800/consolidated.pt, loaded this model and got ASRInferencePipeline using my code load_model_from.py, which proves it workable to load model from user's checkpoints:
# ...
tk = load_tokenizer("omniASR_tokenizer_written_v2")
pipeline = ASRInferencePipeline(model_card=None, model=model, tokenizer=tk)
My codes:
merge_sharded_ckpt.py
load_model_from.py
First I finetuned basic model
omniASR_LLM_1B_v2like this:After that I get checkpoints located in
path/to/checkpoints, likestep_800/model/pp_00/tp_00containssdp_00.pt,sdp_01.ptandsdp_02.pt.Now I want to start a new round of finetuning based on a certain checkpoint, rather than the original model like
omniASR_LLM_1B_v2. So I modifed the my-llm-finetune.yaml as below. I made 2 attempts, one addingmodel.pathwhile the other addingpretrained_encoder.name/path/family/dtype.Complete config.yaml: config-onlymodifiedmodel.yaml
However, I got error information:
More details: rank_0.log
Maybe it's worth noting that I had successfully merged them into a single file
step_800/consolidated.pt, loaded this model and gotASRInferencePipelineusing my codeload_model_from.py, which proves it workable to load model from user's checkpoints:My codes:
merge_sharded_ckpt.py
load_model_from.py