From 428c83d1d804d02b755001cc36522b04ca3b7817 Mon Sep 17 00:00:00 2001 From: Daniel Maddern Date: Wed, 19 Aug 2026 22:51:48 +0700 Subject: [PATCH] Coerce token ids to int in build_fl2va_presentation --- src/h3_blackwell_runtime/qwen3vl_vision.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/h3_blackwell_runtime/qwen3vl_vision.py b/src/h3_blackwell_runtime/qwen3vl_vision.py index 44ed372..48c557e 100644 --- a/src/h3_blackwell_runtime/qwen3vl_vision.py +++ b/src/h3_blackwell_runtime/qwen3vl_vision.py @@ -462,15 +462,16 @@ def build_fl2va_presentation( for tok, kind in entries: if kind == "image": flatten, grid, merged, deepstack, size = vision_outputs[vision_index] + size = int(size) start = len(token_ids) token_ids.extend([0] * size) # placeholder ids, overwritten by the merged rows embeds_info.append({"type": "image", "index": start, "size": size, "extra": {"grid": grid, "deepstack": deepstack, "merged": merged}}) vision_index += 1 else: - token_ids.append(tok) + token_ids.append(int(tok)) seq_len = len(token_ids) - input_ids = torch.tensor(token_ids, device=device) + input_ids = torch.tensor([int(t) for t in token_ids], dtype=torch.long, device=device) # Build the Qwen hidden-state input: scaled token embeds, with the merged vision # rows spliced over the pad positions.