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

Class CacheHook

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

Source from the content-addressed store, hash-verified

158
159
160class CacheHook:
161 def __init__(self, cachinglm) -> None:
162 if cachinglm is None:
163 self.dbdict = None
164 return
165
166 self.dbdict = cachinglm.dbdict
167
168 def add_partial(self, attr, req, res) -> None:
169 if self.dbdict is None:
170 return
171 hsh = hash_args(attr, req)
172 self.dbdict[hsh] = res
173
174
175class CachingLM:

Callers 2

__init__Method · 0.85
get_cache_hookMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected