Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pass rope_theta argument when initializing LlamaLikeBlock for models like qwen2, mistral, etc. #568

Merged
merged 1 commit into from
Aug 4, 2024

Conversation

Shuai-Xie
Copy link
Contributor

This PR aims to fix this issue #567.

    def fuse_transformer(self):
            ...
            blocks.append(
                LlamaLikeBlock(
                    hidden_size=self.model.config.hidden_size,
                    n_heads=self.model.config.num_attention_heads,
                    n_kv_heads=self.model.config.num_key_value_heads,
                    qkv_layer=qkv,
                    o_proj=module.self_attn.o_proj,
                    mlp=module.mlp,
                    norm_1=norm_1,
                    norm_2=norm_2,
                    dev=device,
                    max_seq_len=self.model.config.max_seq_len,
                    rope_theta=self.model.config.rope_theta,                # only add this line.
                )
            )

@casper-hansen
Copy link
Owner

Thanks for the fix!

@casper-hansen casper-hansen reopened this Aug 4, 2024
@casper-hansen casper-hansen merged commit 202b967 into casper-hansen:main Aug 4, 2024
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