[Minor] Various small code cleanups/simplifications (#31508)

Signed-off-by: njhill <nickhill123@gmail.com>
This commit is contained in:
Nick Hill
2025-12-29 22:42:06 -08:00
committed by GitHub
parent f84bf7d79b
commit 3b312fb792
14 changed files with 29 additions and 55 deletions

View File

@@ -1579,14 +1579,14 @@ class ModelConfig:
@property
def is_hybrid(self) -> bool:
if not self._model_info.is_hybrid:
return False
# 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(
return layer_types is None or not all(
layer == "attention" for layer in layer_types
):
return False
return self._model_info.is_hybrid
)
@property
def has_noops(self) -> bool: