MCPcopy Index your code
hub / github.com/mudler/LocalAI / get_layers

Function get_layers

backend/python/mlx-distributed/sharding.py:88–94  ·  view source on GitHub ↗

Get the list of transformer layers.

(inner_model)

Source from the content-addressed store, hash-verified

86
87
88def get_layers(inner_model):
89 """Get the list of transformer layers."""
90 for attr in ("layers", "h"):
91 layers = getattr(inner_model, attr, None)
92 if layers is not None:
93 return layers
94 raise ValueError("Model must have a 'layers' or 'h' attribute")
95
96
97def pipeline_auto_parallel(model, group, start_layer=None, end_layer=None):

Callers 1

pipeline_auto_parallelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected