MCPcopy Create free account
hub / github.com/OpenSparseLLMs/MoM / register_model

Function register_model

lm-eval-harness/lm_eval/api/registry.py:13–30  ·  view source on GitHub ↗
(*names)

Source from the content-addressed store, hash-verified

11
12
13def register_model(*names):
14 # either pass a list or a single alias.
15 # function receives them as a tuple of strings
16
17 def decorate(cls):
18 for name in names:
19 assert issubclass(
20 cls, LM
21 ), f"Model '{name}' ({cls.__name__}) must extend LM class"
22
23 assert (
24 name not in MODEL_REGISTRY
25 ), f"Model named '{name}' conflicts with existing model! Please register with a non-conflicting alias instead."
26
27 MODEL_REGISTRY[name] = cls
28 return cls
29
30 return decorate
31
32
33def get_model(model_name):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected