Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
lm-evaluation-harness
Commits
51d6951c
Unverified
Commit
51d6951c
authored
Jun 13, 2023
by
Hailey Schoelkopf
Committed by
GitHub
Jun 13, 2023
Browse files
Merge pull request #584 from gakada/perf
Fix non-callable attributes in CachingLM
parents
4c08d72a
d4889e1a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
lm_eval/base.py
lm_eval/base.py
+4
-0
lm_eval/evaluator.py
lm_eval/evaluator.py
+1
-1
No files found.
lm_eval/base.py
View file @
51d6951c
...
@@ -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
=
[]
...
...
lm_eval/evaluator.py
View file @
51d6951c
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment