Use head_dim in config if exists (#2622)
This commit is contained in:
parent
beb89f68b4
commit
220a47627b
@ -213,6 +213,8 @@ class ModelConfig:
|
||||
return self.hf_config.hidden_size
|
||||
|
||||
def get_head_size(self) -> int:
|
||||
if hasattr(self.hf_config, "head_dim"):
|
||||
return self.hf_config.head_dim
|
||||
# FIXME(woosuk): This may not be true for all models.
|
||||
return self.hf_config.hidden_size // self.hf_config.num_attention_heads
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user