e5 mistral 7b instruct
1.0.0
docker build -t pytorch . docker run --gpus=all --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 -it --rm -v $( pwd ) :/e5-mistral-7b-instruct/ pytorch bash เรียกใช้ prepare_dataset เพื่อสร้างชุดข้อมูลที่คล้ายคลึงกันด้วยคู่ Postive และลบหนึ่งคู่จาก SNLI
python prepare_dataset.py ตั้งค่าโมเดลแคชโฟลเดอร์ export TRANSFORMERS_CACHE=.cache/
ก่อนอื่นให้เรียก accelerate config --config_file ds_zero3_cpu.yaml
ตรวจสอบไฟล์ตัวอย่างสำหรับ GPU เดียวที่นี่
พารามิเตอร์ที่ระบุด้านล่างนี้นำมาจากกระดาษเพื่อ finetuning ปรับการเพิ่มขึ้นกับชุดข้อมูลและ USECASE ของคุณ
accelerate launch
--config_file ds_zero3_cpu.yaml
peft_lora_embedding_semantic_search.py
--dataset_name similarity_dataset
--max_length 512
--model_name_or_path intfloat/e5-mistral-7b-instruct
--per_device_train_batch_size 1
--per_device_eval_batch_size 1
--learning_rate 0.0001
--weight_decay 0.01
--max_train_steps 1000
--gradient_accumulation_steps 2048
--lr_scheduler_type linear
--num_warmup_steps 100
--output_dir trained_model
--use_peftฟังก์ชั่นการสูญเสียคัดลอกมาจากที่นี่-> https://github.com/relbers/info-nce-pytorch