MCPcopy
hub / github.com/z-lab/dflash / _get_layers

Function _get_layers

dflash/model_mlx.py:274–281  ·  view source on GitHub ↗
(model)

Source from the content-addressed store, hash-verified

272
273
274def _get_layers(model):
275 if hasattr(model, "model") and hasattr(model.model, "layers"):
276 return model.model.layers
277 if hasattr(model, "language_model") and hasattr(model.language_model, "layers"):
278 return model.language_model.layers
279 if hasattr(model, "layers"):
280 return model.layers
281 raise AttributeError(f"Cannot find layers in {type(model).__name__}")
282
283
284def _patch_model(model, layer_ids):

Callers 1

_patch_modelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected