Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Query num_key_value_heads when available to support GQA models.
Models with GQA implemented would not have the same number of heads for K,V vs Query. Hence we need to query `num_key_value_heads` attribute to see if we require different value for KV cache size. Not all model has `num_key_value_heads` as a part of their config such as QWEN. Phi has it, but it is set to null, hence the code is structured this way to handle those cases.
- Loading branch information