Unverified Commit 64d57c3b authored by Thomas Parnell's avatar Thomas Parnell Committed by GitHub
Browse files

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


Signed-off-by: default avatarThomas Parnell <tpa@zurich.ibm.com>
parent a1e7fa36
...@@ -1619,6 +1619,13 @@ class ModelConfig: ...@@ -1619,6 +1619,13 @@ class ModelConfig:
@property @property
def is_hybrid(self) -> bool: 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 return self._model_info.is_hybrid
@property @property
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment