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

Method __init__

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

Defines the interface that should be implemented by all LM subclasses. LMs are assumed to take text (strings) as input and yield strings as output (inputs/outputs should be tokenization-agnostic.)

(self)

Source from the content-addressed store, hash-verified

18
19class LM(abc.ABC):
20 def __init__(self) -> None:
21 """Defines the interface that should be implemented by all LM subclasses.
22 LMs are assumed to take text (strings) as input and yield strings as output
23 (inputs/outputs should be tokenization-agnostic.)
24
25 """
26 # set rank and world size to a single process, by default.
27 self._rank = 0
28 self._world_size = 1
29 self.cache_hook = CacheHook(None)
30
31 @abc.abstractmethod
32 def loglikelihood(self, requests) -> List[Tuple[float, bool]]:

Callers

nothing calls this directly

Calls 1

CacheHookClass · 0.85

Tested by

no test coverage detected