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

Method create_from_arg_string

lm-eval-harness/lm_eval/api/model.py:118–134  ·  view source on GitHub ↗

Creates an instance of the LM class using the given argument string and additional config. Parameters: - arg_string: A string containing arguments in the format key1=value1,key2=value2. - additional_config: Optional dictionary containing additional configuration par

(
        cls: Type[T], arg_string: str, additional_config: Optional[dict] = None
    )

Source from the content-addressed store, hash-verified

116
117 @classmethod
118 def create_from_arg_string(
119 cls: Type[T], arg_string: str, additional_config: Optional[dict] = None
120 ) -> T:
121 """
122 Creates an instance of the LM class using the given argument string and additional config.
123
124 Parameters:
125 - arg_string: A string containing arguments in the format key1=value1,key2=value2.
126 - additional_config: Optional dictionary containing additional configuration parameters.
127
128 Returns:
129 - Instance of the LM class.
130 """
131 additional_config = {} if additional_config is None else additional_config
132 args = utils.simple_parse_args_string(arg_string)
133 args2 = {k: v for k, v in additional_config.items() if v is not None}
134 return cls(**args, **args2)
135
136 @property
137 def rank(self):

Callers 1

simple_evaluateFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected