Skip to content

Fix shape mismatch error in gears caused by varying choose_binset#79

Open
OBJECT907 wants to merge 3 commits into
biomap-research:mainfrom
OBJECT907:12_27_shape_fix
Open

Fix shape mismatch error in gears caused by varying choose_binset#79
OBJECT907 wants to merge 3 commits into
biomap-research:mainfrom
OBJECT907:12_27_shape_fix

Conversation

@OBJECT907
Copy link
Copy Markdown

@OBJECT907 OBJECT907 commented Dec 27, 2025

Issue:

In the gears module, using different binset configurations results in a varying number of tokens. This causes a shape mismatch error when attempting to add positional embeddings, as the sequence length exceeds or differs from the expected dimensions (positional embeddings is always [num_genes, hidden_size])

Fix:

I added a truncation operation to ensure the input sequence length aligns with the model's expectations. The code now explicitly slices the input to keep only the first num_genes tokens before adding positional embeddings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants