[Model] [Config] Correctly identify granite-4.0-micro as non-hybrid model (#28563)

Signed-off-by: Thomas Parnell <tpa@zurich.ibm.com>
This commit is contained in:
Thomas Parnell 2025-11-12 19:17:55 +01:00 committed by GitHub
parent a1e7fa362a
commit 64d57c3be7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1619,6 +1619,13 @@ class ModelConfig:
@property
def is_hybrid(self) -> bool:
# Handle granite-4.0-micro case which uses hybrid config but does not
# actually contain any non-attention layers.
layer_types = getattr(self.hf_config, "layer_types", None)
if layer_types is not None and all(
layer == "attention" for layer in layer_types
):
return False
return self._model_info.is_hybrid
@property