Closed sjuxax closed 7 months ago
yes im aware of this problem about moondream on other platforms (it works on linux and windows) , i couldnt solve it for mac users. i will look into this in near future.
Same here, Ubuntu 22.04 comfyui up to date...
Same here, Ubuntu 22.04 comfyui up to date...
i wish i can reproduce same error but in colab(linux) or in my pc windows so i can iterate on this error but it works in both case.
i just tried it on colab
i created a complete new conda env with python=3.11. cloned the official comfyui repo. cloned your repo and added the same nodes as you have.
File "/home/dev/ComfyUI/custom_nodes/ComfyUI_VLM_nodes/nodes/moondream/phi/modeling_phi.py", line 462, in forward padding_mask.masked_fill_(key_padding_mask, 0.0) RuntimeError: The expanded size of the tensor (748) must match the existing size (749) at non-singleton dimension 1. Target sizes: [1, 748]. Tensor sizes: [1, 749]
Same problem. Also its a standard ubuntu 22.04 install with a RTX4090.
That's very strange, this also happen to me with Ubuntu 22.04 and RTX 3090.
A quick fix is to replace:
if key_padding_mask is not None:
padding_mask = torch.full(
(batch_size, seqlen), -10000.0, dtype=scores.dtype, device=scores.device
)
padding_mask.masked_fill_(key_padding_mask, 0.0)
scores = scores + rearrange(padding_mask, "b s -> b 1 1 s")
With
if key_padding_mask is not None:
padding_mask = torch.full(
(batch_size, seqlen_k),
-10000.0,
dtype=scores.dtype,
device=scores.device,
)
key_padding_mask = key_padding_mask[:, :seqlen_k]
padding_mask.masked_fill_(key_padding_mask, 0.0)
scores = scores + rearrange(padding_mask, "b s -> b 1 1 s")
thanks for the help. i added this fix to the repo. i also checked it didnt broke the working ones.
Tried the Moondream node and it says this: