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
607d7da5
Unverified
Commit
607d7da5
authored
Jan 22, 2024
by
Brian Vaughan
Committed by
GitHub
Jan 22, 2024
Browse files
fallback to classname when LM doesnt have config (#1334)
parent
5c25dd55
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
lm_eval/evaluator.py
lm_eval/evaluator.py
+8
-3
No files found.
lm_eval/evaluator.py
View file @
607d7da5
...
@@ -158,11 +158,16 @@ def simple_evaluate(
...
@@ -158,11 +158,16 @@ def simple_evaluate(
)
)
if
lm
.
rank
==
0
:
if
lm
.
rank
==
0
:
if
isinstance
(
model
,
str
):
model_name
=
model
elif
hasattr
(
model
,
"config"
)
and
hasattr
(
model
.
config
,
"_name_or_path"
):
model_name
=
model
.
config
.
_name_or_path
else
:
model_name
=
type
(
model
).
__name__
# add info about the model and few shot config
# add info about the model and few shot config
results
[
"config"
]
=
{
results
[
"config"
]
=
{
"model"
:
model
"model"
:
model_name
,
if
isinstance
(
model
,
str
)
else
model
.
model
.
config
.
_name_or_path
,
"model_args"
:
model_args
,
"model_args"
:
model_args
,
"batch_size"
:
batch_size
,
"batch_size"
:
batch_size
,
"batch_sizes"
:
list
(
lm
.
batch_sizes
.
values
())
"batch_sizes"
:
list
(
lm
.
batch_sizes
.
values
())
...
...
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