Unverified Commit e922cceb authored by Baber Abbasi's avatar Baber Abbasi Committed by GitHub
Browse files

fix cache (#2037)

parent 801322e0
......@@ -246,9 +246,10 @@ class CachingLM:
# add hook to lm
lm.set_cache_hook(self.get_cache_hook())
def __getattr__(self, attr):
def __getattr__(self, attr: str):
lm_attr = getattr(self.lm, attr)
if not callable(lm_attr):
if attr not in ["loglikelihood", "loglikelihood_rolling", "generate_until"]:
eval_logger.debug(f"Passing through attribute '{attr}' to underlying LM")
return lm_attr
def fn(requests):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment