Skip to content

Commit

Permalink
fix AttributeError: 'MixtralLayer' object has no attribute 'mlp' (#2123)
Browse files Browse the repository at this point in the history
  • Loading branch information
icyxp authored and ErikKaum committed Jul 26, 2024
1 parent f92eca2 commit e940b35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/text_generation_server/models/flash_mistral.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def adapter_target_to_layer(self) -> Dict[str, Tuple[str, torch.Tensor]]:

# TODO: this is a hack to avoid the gate_proj for
# FlashStarcoder2 that doesnt have these layers
if hasattr(layer.mlp, "gate_up_proj"):
if hasattr(layer, "mlp") and hasattr(layer.mlp, "gate_up_proj"):
layer_weights[(i, "gate_proj")] = (
f"{prefix}.{i}.mlp.gate_proj",
layer.mlp.gate_up_proj,
Expand Down

0 comments on commit e940b35

Please sign in to comment.