Support fine-tuning
#12
by
tastelikefeet
- opened
README.md
CHANGED
@@ -3748,6 +3748,48 @@ The [MTEB Leaderboard](https://huggingface.co/spaces/mteb/leaderboard) English t
|
|
3748 |
|
3749 |
**More detailed experimental results can be found in the [paper](http://arxiv.org/abs/2412.16855)**.
|
3750 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3751 |
|
3752 |
## Limitations
|
3753 |
|
|
|
3748 |
|
3749 |
**More detailed experimental results can be found in the [paper](http://arxiv.org/abs/2412.16855)**.
|
3750 |
|
3751 |
+
## Community support
|
3752 |
+
|
3753 |
+
### Fine-tuning
|
3754 |
+
|
3755 |
+
GME models can be fine-tuned by SWIFT:
|
3756 |
+
|
3757 |
+
```shell
|
3758 |
+
pip install ms-swift -U
|
3759 |
+
```
|
3760 |
+
|
3761 |
+
```shell
|
3762 |
+
# MAX_PIXELS settings to reduce memory usage
|
3763 |
+
# check: https://swift.readthedocs.io/en/latest/BestPractices/Embedding.html
|
3764 |
+
nproc_per_node=8
|
3765 |
+
MAX_PIXELS=1003520 \
|
3766 |
+
USE_HF=1 \
|
3767 |
+
NPROC_PER_NODE=$nproc_per_node \
|
3768 |
+
swift sft \
|
3769 |
+
--model Alibaba-NLP/gme-Qwen2-VL-2B-Instruct \
|
3770 |
+
--train_type lora \
|
3771 |
+
--dataset 'HuggingFaceM4/TextCaps:emb' \
|
3772 |
+
--torch_dtype bfloat16 \
|
3773 |
+
--num_train_epochs 1 \
|
3774 |
+
--per_device_train_batch_size 2 \
|
3775 |
+
--per_device_eval_batch_size 2 \
|
3776 |
+
--gradient_accumulation_steps $(expr 64 / $nproc_per_node) \
|
3777 |
+
--eval_steps 100 \
|
3778 |
+
--save_steps 100 \
|
3779 |
+
--eval_strategy steps \
|
3780 |
+
--save_total_limit 5 \
|
3781 |
+
--logging_steps 5 \
|
3782 |
+
--output_dir output \
|
3783 |
+
--lazy_tokenize true \
|
3784 |
+
--warmup_ratio 0.05 \
|
3785 |
+
--learning_rate 5e-6 \
|
3786 |
+
--deepspeed zero3 \
|
3787 |
+
--dataloader_num_workers 4 \
|
3788 |
+
--task_type embedding \
|
3789 |
+
--loss_type infonce \
|
3790 |
+
--dataloader_drop_last true
|
3791 |
+
```
|
3792 |
+
|
3793 |
|
3794 |
## Limitations
|
3795 |
|