"vscode:/vscode.git/clone" did not exist on "0338ca4b7b60e5c91443e39030fd66a4f92ef67c"
Commit d4889e1a authored by gk's avatar gk
Browse files

Fix non-callable attributes in CachingLM

parent 8cec82b2
...@@ -868,6 +868,10 @@ class CachingLM: ...@@ -868,6 +868,10 @@ class CachingLM:
lm.set_cache_hook(self.get_cache_hook()) lm.set_cache_hook(self.get_cache_hook())
def __getattr__(self, attr): def __getattr__(self, attr):
lm_attr = getattr(self.lm, attr)
if not callable(lm_attr):
return lm_attr
def fn(requests): def fn(requests):
res = [] res = []
remaining_reqs = [] remaining_reqs = []
......
...@@ -109,7 +109,7 @@ def simple_evaluate( ...@@ -109,7 +109,7 @@ def simple_evaluate(
"model_args": model_args, "model_args": model_args,
"num_fewshot": num_fewshot, "num_fewshot": num_fewshot,
"batch_size": batch_size, "batch_size": batch_size,
"batch_sizes": list(lm.batch_sizes.values()), "batch_sizes": list(lm.batch_sizes.values()) if hasattr(lm, "batch_sizes") else [],
"device": device, "device": device,
"no_cache": no_cache, "no_cache": no_cache,
"limit": limit, "limit": limit,
......
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