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
e96c6484
Commit
e96c6484
authored
Dec 13, 2023
by
lintangsutawika
Browse files
allow doc_to_choice to be a single feature from a dataset
parent
cd4ef5e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
lm_eval/api/task.py
lm_eval/api/task.py
+4
-1
No files found.
lm_eval/api/task.py
View file @
e96c6484
...
@@ -936,7 +936,10 @@ class ConfigurableTask(Task):
...
@@ -936,7 +936,10 @@ class ConfigurableTask(Task):
doc_to_choice
=
self
.
config
.
doc_to_choice
doc_to_choice
=
self
.
config
.
doc_to_choice
if
type
(
doc_to_choice
)
==
str
:
if
type
(
doc_to_choice
)
==
str
:
return
ast
.
literal_eval
(
utils
.
apply_template
(
doc_to_choice
,
doc
))
if
doc_to_choice
in
self
.
features
:
return
doc
[
doc_to_choice
]
else
:
return
ast
.
literal_eval
(
utils
.
apply_template
(
doc_to_choice
,
doc
))
elif
type
(
doc_to_choice
)
==
list
:
elif
type
(
doc_to_choice
)
==
list
:
return
doc_to_choice
return
doc_to_choice
elif
type
(
doc_to_choice
)
==
dict
:
elif
type
(
doc_to_choice
)
==
dict
:
...
...
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