[Bugfix]: phi.py get rope_theta from config file (#9503)

Co-authored-by: Isotr0py <2037008807@qq.com>
This commit is contained in:
Falko1 2024-10-22 04:53:36 +02:00 committed by GitHub
parent 29acd2c34c
commit 74692421f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -102,8 +102,9 @@ class PhiAttention(nn.Module):
# pylint: disable=C0301
# Refer to:
# https://huggingface.co/microsoft/phi-1_5/blob/d212a789620c380ff32ca1d1ee9943a777360987/modeling_phi.py#L518
rope_theta = 10000
max_position_embeddings = getattr(config, "n_positions", 2048)
rope_theta = getattr(config, "rope_theta", 10000.0)
max_position_embeddings = getattr(config, "max_position_embeddings",
2048)
self.rotary_emb = get_rope(
self.head_size,
rotary_dim=rotary_dim,