Instructions to use nmslmgl/SSVAL-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use nmslmgl/SSVAL-7B with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("./checkpoints/Qwen2.5-7B-Instruct") model = PeftModel.from_pretrained(base_model, "nmslmgl/SSVAL-7B") - Notebooks
- Google Colab
- Kaggle
File size: 3,777 Bytes
ecb19ff | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | ---
base_model: Qwen/Qwen2.5-7B-Instruct
library_name: peft
license: apache-2.0
tags:
- multimodal
- vision-language
- lora
- ssval
- vapi
- mllm
- distillation
---
# SSVAL-7B
This is the released checkpoint of **SSVAL (Spatial-Spectral Visual
Anchor Learning)** built on top of Qwen2.5-7B-Instruct with a CLIP
ViT-L/14-336 vision tower. It is the artefact produced by the
two-stage pipeline described in the paper:
1. **Projector pretraining** on LLaVA-Pretrain LCS-558K.
2. **Visual instruction tuning** on LLaVA-665K with SPARA + SPERA losses.
The checkpoint ships as a **PEFT LoRA adapter + mm-projector**: it is
*not* a standalone model. To use it you must pair it with the base
LLM `Qwen/Qwen2.5-7B-Instruct` and the vision tower
`openai/clip-vit-large-patch14-336`.
## Files
| File | Size | What it is |
|---|---|---|
| `adapter_model.safetensors` | ~620 MB | LoRA adapter (rank 128, alpha 256) over the LLM's attention and MLP projections |
| `non_lora_trainables.bin` | ~170 MB | Multimodal projector and any other non-LoRA trainables saved separately |
| `adapter_config.json` | <1 KB | PEFT adapter configuration |
| `config.json` | ~4 KB | Full model configuration including vision-side and CPD settings |
| `trainer_state.json` | ~3 MB | Training-step / loss history (optional, kept for reproducibility) |
## Required base dependencies
```python
# pip install: transformers==4.37.2, torch>=2.1, peft>=0.10,
# Pillow, accelerate, einops
```
See the companion code repository
[`msls38/SSVAL_code`](https://github.com/msls38/SSVAL_code) for the
load_pretrained_model helper, evaluation scripts, and full dependency
pins.
## Vision encoder and VFM teacher
| Component | Choice |
|---|---|
| Vision tower (`mm_vision_tower`) | `clip-vit-large-patch14-336` |
| Patch selection layer (`mm_vision_select_layer`) | -2 (second-to-last) |
| Feature type (`mm_vision_select_feature`) | `patch` |
| Image aspect ratio | `pad` |
| Patch merge | `flat` |
| MM projector type | `mlp2x_gelu` |
| Image-token wrapping | `<image>` only (no `<im_start>` / `<im_end>`) |
**VFM teacher (training-time only, not needed at inference).**
| Field | Value |
|---|---|
| `vfm_target` | `dinov2-vit-b` |
| `num_vision_prompts` | 4 |
| `num_vfm_prompts` | 4 |
| `cpd_target_layers` | `[14]` |
| Multi-scale factors | `[1, 2, 4]` |
## How to load and use
The companion repo's evaluation entry points expect the following on-disk
layout:
```
checkpoints/
├── Qwen2.5-7B-Instruct/ # base LLM, from Qwen/Qwen2.5-7B-Instruct
└── clip-vit-large-patch14-336/ # vision tower, from openai/clip-vit-large-patch14-336
```
Then, for single-image inference:
```bash
python SSVAL/src/inference.py \
--model-path ./SSVAL-7B \
--model-base ./checkpoints/Qwen2.5-7B-Instruct \
--image-path ./my_image.jpg \
--prompt "Describe this image."
```
For benchmark evaluation, e.g. MME:
```bash
python SSVAL/src/eval_mme.py \
--model-path ./SSVAL-7B \
--model-base ./checkpoints/Qwen2.5-7B-Instruct \
--mme-path ./playground/benchmarks/MME/MME_Benchmark
```
The benchmark scripts run end-to-end without modification once the
companion code is installed and the dataset / benchmark directories are
populated as described in the repository README.
## Citation
If you use this checkpoint, please cite the SSVAL paper (full bibtex to
be added once the paper is publicly available).
## License
- The LoRA weights and configuration in this repository are released
under the **Apache License 2.0** (matching the SSVAL code repository).
- The base LLM `Qwen2.5-7B-Instruct` is subject to its own license
([Qwen2.5 LICENSE](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct)).
- The vision tower is subject to the **OpenAI CLIP LICENSE**.
|