mirror of
https://github.com/OpenBMB/MiniCPM-V.git
synced 2026-02-05 18:29:18 +08:00
Update to MiniCPM-Llama3-V 2.5
This commit is contained in:
@@ -1,18 +1,13 @@
|
||||
# Minicpm-V2 Finetuning
|
||||
# MiniCPM-V Finetuning
|
||||
|
||||
<div align="center">
|
||||
|
||||
[English](README.md)
|
||||
|
||||
</div>
|
||||
|
||||
We offer the official scripts for easy finetuning of the pretrained minicpm-v2 model on downstream tasks. Our finetune scripts use DeepSpeed by default.
|
||||
We offer the official scripts for easy finetuning of the pretrained **MiniCPM-Llama3-V 2.5** and **MiniCPM-V 2.0** on downstream tasks. Our finetune scripts use transformers Trainer and DeepSpeed by default.
|
||||
|
||||
### Data preparation
|
||||
|
||||
To prepare your finetuning data, you should (1) formulate each sample as a dictionary consisting of an id, an image path list with an image (optional, not required for pure-text example), and a list of conversations, and (2) save data samples in JSON files.
|
||||
To prepare your finetuning data, you should formulate each sample as a dictionary consisting of an id, an image path list with an image, and a list of conversations. Then save data samples in JSON files.
|
||||
|
||||
For the vision-language example with image, you are required to define placeholder(s) <ImageHere> to define the position to insert the image embeddings.
|
||||
For the vision-language example with image, you are required to provide **\<image\>** to define the position to insert the image embeddings. If you don't provide \<image\>, the image will be placed at the front of the conversation.
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
@@ -57,10 +52,19 @@ For the vision-language example with image, you are required to define placehold
|
||||
|
||||
### Full-parameter finetuning
|
||||
|
||||
Full-parameter parameter finetuning requires updating all parameters of LLM in the whole training process. To launch your training, run the following script:
|
||||
Full-parameter parameter finetuning requires updating all parameters of LLM in the whole training process. Please specify the correct MODEL path and DATA path in the shell scripts.
|
||||
|
||||
```shell
|
||||
MODEL="openbmb/MiniCPM-Llama3-V-2_5" # or openbmb/MiniCPM-V-2
|
||||
DATA="path/to/trainging_data" # json file
|
||||
EVAL_DATA="path/to/test_data" # json file
|
||||
```
|
||||
|
||||
To launch your training, run the following script:
|
||||
|
||||
```
|
||||
sh finetune_ds.sh
|
||||
```
|
||||
|
||||
#### Customizing Hyperparameters
|
||||
To tailor the training process according to your specific requirements, you can adjust various hyperparameters. For comprehensive documentation on available hyperparameters and their functionalities, you can refer to the [official Transformers documentation](https://huggingface.co/docs/transformers/main_classes/trainer#transformers.TrainingArguments). Experimentation and fine-tuning of these parameters are essential for achieving optimal model performance tailored to your specific task and dataset.
|
||||
|
||||
Reference in New Issue
Block a user