[Misc]Add customized information for models (#4132)

This commit is contained in:
Jee Li
2024-04-30 21:18:14 -07:00
committed by GitHub
parent c3845d82dc
commit d6f4bd7cdd
9 changed files with 87 additions and 0 deletions
@@ -156,6 +156,12 @@ class RotaryEmbedding(nn.Module):
self.cos_sin_cache, self.is_neox_style)
return query, key
def extra_repr(self) -> str:
s = f"head_size={self.head_size}, rotary_dim={self.rotary_dim}"
s += f", max_position_embeddings={self.max_position_embeddings}"
s += f", base={self.base}, is_neox_style={self.is_neox_style}"
return s
class LinearScalingRotaryEmbedding(RotaryEmbedding):
"""RotaryEmbedding extended with linear scaling.