-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from ddlBoJack/dev-mzy
update audio dataset and model
- Loading branch information
Showing
19 changed files
with
2,016 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
#!/bin/bash | ||
# export PYTHONPATH=/root/whisper:$PYTHONPATH | ||
export PYTHONPATH=/root/fairseq:$PYTHONPATH | ||
export CUDA_VISIBLE_DEVICES=0 | ||
# export CUDA_LAUNCH_BLOCKING=1 | ||
export OMP_NUM_THREADS=1 | ||
|
||
# debug setting for multiple gpus | ||
# export NCCL_DEBUG=INFO | ||
# export NCCL_DEBUG_SUBSYS=ALL | ||
# export TORCH_DISTRIBUTED_DEBUG=INFO | ||
|
||
cd /root/SLAM-LLM | ||
|
||
# speech_encoder_path=/nfs/zhifu.gzf/ckpt/Whisper/large-v2.pt | ||
# speech_encoder_path=/nfs/maziyang.mzy/models/Whisper/large-v2-qwen.pt | ||
audio_encoder_path=/nfs/maziyang.mzy/models/BEATs/BEATs_iter3_plus_AS2M.pt | ||
|
||
llm_path=/nfs/zhifu.gzf/ckpt/Llama-2-7b-hf | ||
# llm_path=/nfs/maziyang.mzy/models/vicuna-13b-v1.5/vicuna-13b-v1.5 | ||
|
||
output_dir=/nfs/maziyang.mzy/exps/debug | ||
|
||
# -m debugpy --listen 5678 --wait-for-client | ||
if [[ $CUDA_VISIBLE_DEVICES != *","* ]]; then | ||
python -m debugpy --listen 5678 --wait-for-client src/llama_recipes/pipeline/finetune.py \ | ||
--model_name aac \ | ||
--freeze_encoder \ | ||
--freeze_llm \ | ||
--llm_name llama-2-7b-hf \ | ||
--llm_path $llm_path \ | ||
--llm_dim 4096 \ | ||
--encoder_name beats \ | ||
--encoder_ds_rate 2 \ | ||
--encoder_path $audio_encoder_path \ | ||
--encoder_dim 768 \ | ||
--encoder_projector linear \ | ||
--encoder_projector_ds_rate 5 \ | ||
--dataset audio_dataset \ | ||
--audio_dataset.train_data_path /nfs/maziyang.mzy/data/librispeech/librispeech_train_960h.jsonl \ | ||
--audio_dataset.val_data_path /nfs/maziyang.mzy/data/librispeech/librispeech_dev_other_filtered.jsonl \ | ||
--batching_strategy custom \ | ||
--num_epochs 100 \ | ||
--batch_size_training 4 \ | ||
--val_batch_size 4 \ | ||
--num_workers_dataloader 1 \ | ||
--lr 1e-4 \ | ||
--output_dir $output_dir \ | ||
--metric acc \ | ||
# --log_file $output_dir/test.log \ | ||
# --use_wandb \ | ||
# --wandb_dir $output_dir \ | ||
# --wandb_entity_name zym22 \ | ||
# --wandb_project_name slam-llm \ | ||
# --wandb_exp_name test \ | ||
# --log_interval 5 \ | ||
# --ckpt_path "/nfs/maziyang.mzy/exps/llama-2-hf-finetune-asr-ds5-proj2048-lr1e-5-whisper-lora-prompt/asr/5/model.pt" \ | ||
# --peft_ckpt "/nfs/maziyang.mzy/exps/llama-2-hf-finetune-asr-ds5-proj2048-lr1e-5-whisper-lora-prompt/asr/5" \ | ||
# --use_peft --peft_method lora \ | ||
|
||
else | ||
torchrun \ | ||
--nnodes 1 \ | ||
--nproc_per_node 2 \ | ||
src/llama_recipes/pipeline/finetune.py \ | ||
--model_name aac \ | ||
--freeze_encoder \ | ||
--freeze_llm \ | ||
--enable_fsdp \ | ||
--llm_name llama-2-7b-hf \ | ||
--llm_path $llm_path \ | ||
--llm_dim 4096 \ | ||
--encoder_name beats \ | ||
--encoder_ds_rate 2 \ | ||
--encoder_path $audio_encoder_path \ | ||
--encoder_dim 768 \ | ||
--encoder_projector linear \ | ||
--encoder_projector_ds_rate 5 \ | ||
--dataset audio_dataset \ | ||
--audio_dataset.train_data_path /nfs/maziyang.mzy/data/librispeech/librispeech_train_960h.jsonl \ | ||
--audio_dataset.val_data_path /nfs/maziyang.mzy/data/librispeech/librispeech_dev_other_filtered.jsonl \ | ||
--batching_strategy custom \ | ||
--num_epochs 100 \ | ||
--batch_size_training 4 \ | ||
--val_batch_size 4 \ | ||
--num_workers_dataloader 4 \ | ||
--lr 1e-4 \ | ||
--output_dir $output_dir \ | ||
--metric acc \ | ||
--log_file /$output_dir/train.log \ | ||
--use_wandb \ | ||
--wandb_dir $output_dir \ | ||
--wandb_entity_name zym22 \ | ||
--wandb_project_name slam-llm \ | ||
--wandb_exp_name test \ | ||
--log_interval 5 \ | ||
# --peft_ckpt "/nfs/maziyang.mzy/exps/llama-2-hf-finetune-asr-ds5-proj2048-lr1e-5-whisper-prompt-padding30-20231228/asr/4" \ | ||
# --ckpt_path "/nfs/maziyang.mzy/exps/llama-2-hf-finetune-asr-ds5-proj2048-lr1e-5-whisper-prompt-padding30-20231228/asr/4/model.pt" \ | ||
# --use_peft --peft_method lora \ | ||
fi | ||
|
||
# {"key": "1001-134707-0000_ASR", "prompt": "<ASR>", "source": "/cpfs01/shared/Group-speech/beinian.lzr/data/open_data/librispeech_audio/audio/se_librispeech_1001-134707-0000.wav", "target": "1 little recks the laborer. How near his work is holding him to God, The loving laborer through space and time, after all, not to create, only or found only.", "target_len": 157, "source_len": 1581, "text-type": "Transcribe", "audio_language": "en", "text_language": "en", "task-type": "<ASR>"} | ||
# {"key": "1688-142285-0005", "prompt": "<ASR>", "source": "/nfs/beinian.lzr/workspace/datasets/data/16k/opendata/librispeech/test_other/wav/1688-142285-0005.wav", "target": "YOU WHO WERE ALWAYS ACCUSING PEOPLE OF BEING SHOPPY AT HELSTONE", "target_len": 11, "source_len": 220, "text-type": "Transcribe", "audio_language": "en", "text_language": "en", "task-type": "<ASR>"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.