major refactor of the forward pass and model input conversion

This commit is contained in:
Maxime Ellerbach
2026-06-09 12:14:43 +00:00
committed by Maximellerbach
parent 877847c90e
commit 31ddb8f493
4 changed files with 184 additions and 304 deletions
+4 -2
View File
@@ -215,8 +215,10 @@ class _FakeQwenInterface(nn.Module):
@staticmethod
def to_pixel_values(image_tensor: Tensor) -> Tensor:
image = image_tensor.detach().float()
if image.ndim == 3 and image.shape[0] == 1:
image = image.repeat(3, 1, 1)
if image.shape[-3] == 1:
repeats = [1] * image.ndim
repeats[-3] = 3
image = image.repeat(*repeats)
return image