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

Method set_config

lm-eval-harness/lm_eval/api/task.py:630–643  ·  view source on GitHub ↗

Set or update the configuration for a given key.

(self, key: str, value: Any, update: bool = False)

Source from the content-addressed store, hash-verified

628 return self.config.to_dict()
629
630 def set_config(self, key: str, value: Any, update: bool = False) -> None:
631 """Set or update the configuration for a given key."""
632 if key is None:
633 raise ValueError("Key must be provided.")
634
635 if update:
636 current_value = getattr(self._config, key, {})
637 if not isinstance(current_value, dict):
638 raise TypeError(
639 f"Expected a dict for key '{key}', got {type(current_value).__name__} instead."
640 )
641 current_value.update(value)
642 else:
643 setattr(self._config, key, value)
644
645 def override_metric(self, metric_name: str) -> None:
646 """

Callers 1

simple_evaluateFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected