Skip to content

Commit 37ce47e

Browse files
committed
[TRTLLM-6577][feat] Support nano_v2_vlm in pytorch backend
* clean up codes. * add test_e2e for nano_v2 vlm. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
1 parent d1058ef commit 37ce47e

File tree

3 files changed

+92
-80
lines changed

3 files changed

+92
-80
lines changed

tensorrt_llm/_torch/models/modeling_nanov2vlm.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
12
import copy
23
import os
34
from typing import List, Optional, Tuple
@@ -279,6 +280,11 @@ def __call__(
279280
Image.fromarray((image.permute(1, 2, 0) * 255).to(
280281
torch.uint8).cpu().numpy()) for image in images
281282
]
283+
else:
284+
input_ids = self.tokenizer.encode(text_prompt,
285+
add_special_tokens=False,
286+
return_tensors="pt")
287+
return input_ids[0].to(torch.int32).tolist(), {}
282288

283289
# Processing for multimodal data.
284290
processed_images = self.processor(images=images,

0 commit comments

Comments
 (0)