Support nvidia/NVIDIA-Nemotron-Nano-12B-v2-VL-BF16 (and nvidia/C-RADIOv2-H) (#12277)

This commit is contained in:
Netanel Haber
2025-11-26 16:28:52 -07:00
committed by GitHub
parent a8ef4d1804
commit 082b54c689
17 changed files with 1334 additions and 17 deletions
+7 -2
View File
@@ -36,9 +36,10 @@ def eval_mmmu(args):
try:
# check if the model is belongs to internvl
if "InternVL" in args.model_path:
from internvl_utils import load_image
from transformers import AutoTokenizer
from sglang.srt.multimodal.internvl_utils import image_to_pixel_values
tokenizer = AutoTokenizer.from_pretrained(args.model_path)
model = AutoModel.from_pretrained(
args.model_path,
@@ -80,7 +81,11 @@ def eval_mmmu(args):
assert image is not None
if "InternVL" in args.model_path:
pixel_values = load_image(sample["image_path"]).to(torch.bfloat16).cuda()
image = PIL.Image.open(sample["image_path"]).convert("RGB")
pixel_values = image_to_pixel_values(
image, input_size=448, max_num=12, use_thumbnail=True
)
pixel_values = pixel_values.to(device="cuda", dtype=torch.bfloat16)
contents = ""
if prefix:
contents += prefix