Upload configs/pretrain_12g.yaml with huggingface_hub
Browse files- configs/pretrain_12g.yaml +42 -0
configs/pretrain_12g.yaml
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 预训练配置 - 适配 12G 显存 (4070 Ti)
|
| 2 |
+
# Qwen2-VL-2B fp16/bf16 + LoRA(r=16), 无 4-bit 量化
|
| 3 |
+
|
| 4 |
+
model_name_or_path: "Qwen/Qwen2-VL-2B-Instruct"
|
| 5 |
+
use_spatial_compression: false
|
| 6 |
+
freeze_vision_tower: true
|
| 7 |
+
freeze_llm: false
|
| 8 |
+
use_lora: true
|
| 9 |
+
lora_r: 16
|
| 10 |
+
lora_alpha: 32
|
| 11 |
+
lora_target_modules:
|
| 12 |
+
- "q_proj"
|
| 13 |
+
- "k_proj"
|
| 14 |
+
- "v_proj"
|
| 15 |
+
- "o_proj"
|
| 16 |
+
- "gate_proj"
|
| 17 |
+
- "up_proj"
|
| 18 |
+
- "down_proj"
|
| 19 |
+
lora_dropout: 0.05
|
| 20 |
+
torch_dtype: "bfloat16"
|
| 21 |
+
|
| 22 |
+
# 2B 模型 fp16 约 4GB,12G 显存不需要 4-bit
|
| 23 |
+
load_in_4bit: false
|
| 24 |
+
load_in_8bit: false
|
| 25 |
+
|
| 26 |
+
dataset_type: "jsonl"
|
| 27 |
+
data_path: "data/pretrain/grounding.jsonl"
|
| 28 |
+
image_root: "data/coco/val"
|
| 29 |
+
|
| 30 |
+
batch_size: 2
|
| 31 |
+
gradient_accumulation_steps: 8
|
| 32 |
+
epochs: 3
|
| 33 |
+
learning_rate: 1.0e-4
|
| 34 |
+
weight_decay: 0.01
|
| 35 |
+
warmup_ratio: 0.03
|
| 36 |
+
max_grad_norm: 1.0
|
| 37 |
+
max_length: 512
|
| 38 |
+
image_size: 224
|
| 39 |
+
num_workers: 0
|
| 40 |
+
|
| 41 |
+
save_every: 1
|
| 42 |
+
device: "cuda"
|