add VaseVLM-7B-rl adapter
Browse files
model/7B-rl/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: Qwen/Qwen2.5-VL-7B-Instruct
|
| 3 |
+
library_name: peft
|
| 4 |
+
pipeline_tag: image-text-to-text
|
| 5 |
+
tags:
|
| 6 |
+
- lora
|
| 7 |
+
- vasevlm
|
| 8 |
+
- grpo
|
| 9 |
+
- ancient-greek-pottery
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# VaseVLM-7B-rl
|
| 13 |
+
|
| 14 |
+
GRPO (RL) LoRA adapter for ancient Greek vase captioning (VaseVLM).
|
| 15 |
+
|
| 16 |
+
## ⚠️ IMPORTANT — how to use correctly
|
| 17 |
+
|
| 18 |
+
This RL adapter was trained **on top of the SFT model**, NOT on the raw base model.
|
| 19 |
+
Applying it directly on `Qwen/Qwen2.5-VL-7B-Instruct` will NOT reproduce the results.
|
| 20 |
+
You must stack it on the SFT model:
|
| 21 |
+
|
| 22 |
+
**Step 1 — build the SFT model** = base + SFT adapter (merged)
|
| 23 |
+
**Step 2 — apply this RL adapter** on the SFT model.
|
| 24 |
+
|
| 25 |
+
```python
|
| 26 |
+
from transformers import AutoModelForImageTextToText, AutoProcessor
|
| 27 |
+
from peft import PeftModel
|
| 28 |
+
|
| 29 |
+
# base
|
| 30 |
+
base = AutoModelForImageTextToText.from_pretrained("Qwen/Qwen2.5-VL-7B-Instruct", torch_dtype="bfloat16", device_map="auto")
|
| 31 |
+
|
| 32 |
+
# Step 1: apply SFT adapter and merge -> SFT model
|
| 33 |
+
sft = PeftModel.from_pretrained(base, "AIGeeksGroup/VaseVLM", subfolder="model/7B-sft")
|
| 34 |
+
sft = sft.merge_and_unload()
|
| 35 |
+
|
| 36 |
+
# Step 2: apply this RL adapter on the SFT model
|
| 37 |
+
model = PeftModel.from_pretrained(sft, "AIGeeksGroup/VaseVLM", subfolder="model/7B-rl")
|
| 38 |
+
|
| 39 |
+
processor = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-7B-Instruct")
|
| 40 |
+
```
|
model/7B-rl/adapter_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alora_invocation_tokens": null,
|
| 3 |
+
"alpha_pattern": {},
|
| 4 |
+
"arrow_config": null,
|
| 5 |
+
"auto_mapping": null,
|
| 6 |
+
"base_model_name_or_path": "Qwen/Qwen2.5-VL-7B-Instruct",
|
| 7 |
+
"bias": "none",
|
| 8 |
+
"corda_config": null,
|
| 9 |
+
"ensure_weight_tying": false,
|
| 10 |
+
"eva_config": null,
|
| 11 |
+
"exclude_modules": null,
|
| 12 |
+
"fan_in_fan_out": false,
|
| 13 |
+
"inference_mode": true,
|
| 14 |
+
"init_lora_weights": true,
|
| 15 |
+
"layer_replication": null,
|
| 16 |
+
"layers_pattern": null,
|
| 17 |
+
"layers_to_transform": null,
|
| 18 |
+
"loftq_config": {},
|
| 19 |
+
"lora_alpha": 32,
|
| 20 |
+
"lora_bias": false,
|
| 21 |
+
"lora_dropout": 0.1,
|
| 22 |
+
"megatron_config": null,
|
| 23 |
+
"megatron_core": "megatron.core",
|
| 24 |
+
"modules_to_save": [],
|
| 25 |
+
"peft_type": "LORA",
|
| 26 |
+
"peft_version": "0.18.1",
|
| 27 |
+
"qalora_group_size": 16,
|
| 28 |
+
"r": 8,
|
| 29 |
+
"rank_pattern": {},
|
| 30 |
+
"revision": null,
|
| 31 |
+
"target_modules": "^(model\\.language_model(?=\\.).*\\.(k_proj|q_proj|down_proj|o_proj|gate_proj|v_proj|up_proj))$",
|
| 32 |
+
"target_parameters": null,
|
| 33 |
+
"task_type": "CAUSAL_LM",
|
| 34 |
+
"trainable_token_indices": null,
|
| 35 |
+
"use_dora": false,
|
| 36 |
+
"use_qalora": false,
|
| 37 |
+
"use_rslora": false
|
| 38 |
+
}
|
model/7B-rl/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:75a474569b103b8ffc4b09f747e60b1eb261de135b3cf3dca9f540f2683eb6c6
|
| 3 |
+
size 80797976
|
model/7B-rl/additional_config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"lora_dtype": null, "lorap_lr_ratio": null, "lorap_emb_lr": 1e-06}
|