Skip to content

Commit

Permalink
Use head_dim in config if exists (vllm-project#2622)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangxu-google authored Jan 27, 2024
1 parent 17f61af commit 1b669dd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vllm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ def get_hidden_size(self) -> int:
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

Expand Down

0 comments on commit 1b669dd

Please sign in to comment.