Downloads · 30 days
6
12% of all-time downloads
quiyver/intern-vl-2.5-reward
intern-vl-2.5-reward is a feature extraction model from quiyver. Use it when you need embeddings to search or compare text. It is set up for transformers. The card lists the license as mit.
这是一个基于 OpenGVLab/InternVL25-2B 的多模态标量奖励模型。模型接收图像、问题和候选回答,为每个候选回答输出一个实数 reward。分数仅适合比较同一图像和问题下的候选回答,不应解释为概率。
Downloads · 30 days
6
12% of all-time downloads
All-time downloads
50
Public
Parameters
2.2B
4.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors4.4 GB · 100%
How the weights are stored.
BF162.2B · 100%
From the Hugging Face model README
这是一个基于 OpenGVLab/InternVL2_5-2B 的多模态标量奖励模型。模型接收图像、问题和候选回答,为每个候选回答输出一个实数 reward。分数仅适合比较同一图像和问题下的候选回答,不应解释为概率。
本仓库是完整合并检查点:LoRA 已合并进 InternVL 主干,FP32 score head 也包含在标准 safetensors 分片中。使用时不需要另行下载基座、挂载 PEFT adapter 或手动加载 score_head.pt。
| Benchmark | Correct | Accuracy |
|---|---|---|
| VLRewardBench, full test split | 869 / 1,250 | 69.52% |
评测使用固定大小 448 x 448 的单图输入、最大文本长度 1,536、BF16 推理。基座结果为生成式二选一评测,奖励模型结果为标量排序评测,因此两者并非完全相同的推理形式。
建议使用支持 BF16 的 NVIDIA GPU。
pip install -r requirements.txt
如果直接通过 Hugging Face Hub 加载,只需要安装同版本依赖:
pip install torch==2.8.0 transformers==4.57.6 accelerate==1.10.1 \
timm==1.0.27 einops==0.8.2 sentencepiece==0.2.1 pillow==11.3.0
trust_remote_code=True 是必需的,因为本仓库包含 InternVL 和奖励头的自定义模型代码。
import torch
from transformers import AutoModel, AutoTokenizer
model_id = "quiyver/intern-vl-2.5-reward"
model = AutoModel.from_pretrained(
model_id,
trust_remote_code=True,
dtype=torch.bfloat16,
low_cpu_mem_usage=True,
).cuda().eval()
tokenizer = AutoTokenizer.from_pretrained(
model_id,
trust_remote_code=True,
use_fast=False,
)
scores = model.score_answers(
tokenizer=tokenizer,
image="example.jpg",
question="What is shown in the image?",
answers=[
"A dog is running on grass.",
"A passenger aircraft is taking off.",
],
)
print(scores)
print("preferred answer:", max(range(len(scores)), key=scores.__getitem__))
也可以在克隆后的仓库中运行:
python inference.py \
--model . \
--image example.jpg \
--question "What is shown in the image?" \
--answer "A dog is running on grass." \
--answer "A passenger aircraft is taking off."
评测脚本会直接下载官方 Hugging Face 数据集,并固定数据集 revision:
python eval_vlrewardbench.py \
--model . \
--output results/vlrewardbench_predictions.jsonl
固定的数据版本为:
MMInstruction/VL-RewardBench0e6e62701eba92818a69ce95af0ed7aa0648b176test, 1,250 samples脚本会生成逐样本预测 JSONL 和汇总 JSON,便于核验正确数、准确率、同分数量以及各 query_source 的结果。
OpenGVLab/InternVL2_5-2B573169ee54df216786bb9a189e9a32a060a008cfwqkv, wo, w1, w2, w3LayerNorm(2048) -> Linear(2048, 1024) -> GELU -> Linear(1024, 1)2e-5, followed by 1e-5 during continuation训练和原始评测代码:https://github.com/trizszer/intern_vl_reward,对应 commit fe90ab4cc4421273114d3a3724bc7229a14e841d。
merge_manifest.json 记录了原始基座、LoRA、score head 和所有合并后分片的 SHA-256。模型采用 6 个 safetensors 分片,总参数量 2,207,857,665,其中 score head 保持 FP32,其余主干权重为 BF16。
从本目录执行:
hf auth login
hf upload-large-folder USER_OR_ORG/REPO_NAME . --repo-type model
目标仓库应为空。请上传本目录本身,不要再套一层 base_model/ 或 reward_model/,也不要上传 .cache、训练日志或旧 adapter。