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 ,以創建一個與SNLI的Postive和負面對的相似性數據集。
python prepare_dataset.py設置模型緩存文件夾export TRANSFORMERS_CACHE=.cache/
首先,運行accelerate config --config_file ds_zero3_cpu.yaml
在此處查看單個GPU的示例文件
以下給定參數是從紙上取出的。調整對數據集和用戶酶的重新調整。
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