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
d6030e12
Commit
d6030e12
authored
Aug 16, 2023
by
lintangsutawika
Browse files
reformat
parent
db37024b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
lm_eval/api/task.py
lm_eval/api/task.py
+6
-2
No files found.
lm_eval/api/task.py
View file @
d6030e12
...
...
@@ -793,7 +793,11 @@ class ConfigurableTask(Task):
target_string
=
utils
.
apply_template
(
doc_to_target
,
doc
)
if
target_string
.
isdigit
():
return
ast
.
literal_eval
(
target_string
)
elif
len
(
target_string
)
>=
2
and
(
target_string
[
0
]
==
"["
)
and
(
target_string
[
-
1
]
==
"]"
):
elif
(
len
(
target_string
)
>=
2
and
(
target_string
[
0
]
==
"["
)
and
(
target_string
[
-
1
]
==
"]"
)
):
return
ast
.
literal_eval
(
target_string
)
else
:
return
target_string
...
...
@@ -1006,7 +1010,7 @@ class ConfigurableTask(Task):
gold
=
self
.
doc_to_target
(
doc
)
if
self
.
_config
.
doc_to_choice
is
not
None
:
# If you set doc_to_choice,
# If you set doc_to_choice,
# it assumes that doc_to_target returns a number.
choices
=
self
.
doc_to_choice
(
doc
)
gold
=
choices
[
gold
]
...
...
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