Skip to content

fix: correct clip_txt_pool variable name typo#146

Open
Mr-Neutr0n wants to merge 1 commit intoStability-AI:masterfrom
Mr-Neutr0n:fix/clip-txt-pooled-variable-typo
Open

fix: correct clip_txt_pool variable name typo#146
Mr-Neutr0n wants to merge 1 commit intoStability-AI:masterfrom
Mr-Neutr0n:fix/clip-txt-pooled-variable-typo

Conversation

@Mr-Neutr0n
Copy link

Bug

In modules/stage_c.py, the gen_c_embeddings method unsqueezes clip_txt_pooled into a new variable clip_txt_pool when the tensor is 2D (line 158). However, the subsequent mapper call on line 161 still uses the original clip_txt_pooled — meaning the unsqueeze result is silently discarded.

This is inconsistent with how clip_img is handled two lines below, where clip_img = clip_img.unsqueeze(1) correctly updates the same variable that is then passed to clip_img_mapper.

Fix

Changed clip_txt_pool = clip_txt_pooled.unsqueeze(1) to clip_txt_pooled = clip_txt_pooled.unsqueeze(1) so the unsqueezed tensor is actually used by clip_txt_pooled_mapper, matching the clip_img pattern.

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.

1 participant