internvl2-5-4b-walk-lora-v2-100
Model Description
This is a LoRA adapter for InternVL2.5-4B, fine-tuned on the WalkVLM dataset to assist visually impaired individuals with navigation hazard detection.
How to Use
Method 1: Using PEFT (Recommended)
import torch
from peft import PeftModel
from transformers import AutoModel, AutoTokenizer
base_model = AutoModel.from_pretrained(
"OpenGVLab/InternVL2_5-4B",
torch_dtype=torch.bfloat16,
trust_remote_code=True,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("OpenGVLab/InternVL2_5-4B", trust_remote_code=True)
model = PeftModel.from_pretrained(base_model, "blind-assist/internvl2-5-4b-walk-lora-v2-100")
model = model.merge_and_unload()
response = model.chat(
tokenizer=tokenizer,
pixel_values=pixel_values,
question="Describe any obstacles in this scene.",
generation_config=dict(max_new_tokens=256)
)
Method 2: Manual LoRA Merge
If PEFT doesn't work due to model architecture, use manual merging:
Training Details
Files
adapter_config.json - PEFT LoRA configuration
adapter_model.safetensors - LoRA weights only (~50MB)
License
Same as base model (OpenGVLab/InternVL2_5-4B)
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("OpenGVLab/InternVL2_5-4B") model = PeftModel.from_pretrained(base_model, "blind-assist/internvl2-5-4b-walk-lora-v2-100")