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
1d3599a3
Commit
1d3599a3
authored
Aug 09, 2023
by
lintangsutawika
Browse files
add sampler condition for if target is multiple, and target_delimiter is " "
parent
87e147e1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
lm_eval/api/samplers.py
lm_eval/api/samplers.py
+3
-1
lm_eval/tasks/triviaqa/default.yaml
lm_eval/tasks/triviaqa/default.yaml
+1
-0
No files found.
lm_eval/api/samplers.py
View file @
1d3599a3
...
@@ -48,7 +48,9 @@ class Sampler:
...
@@ -48,7 +48,9 @@ class Sampler:
)
)
+
self
.
target_delimiter
+
self
.
target_delimiter
+
(
+
(
self
.
doc_to_target
(
doc
)
self
.
doc_to_target
(
doc
)[
0
]
if
type
(
self
.
doc_to_target
(
doc
))
is
list
else
self
.
doc_to_target
(
doc
)
if
(
if
(
self
.
config
.
doc_to_choice
is
None
self
.
config
.
doc_to_choice
is
None
or
type
(
self
.
doc_to_target
(
doc
))
is
str
or
type
(
self
.
doc_to_target
(
doc
))
is
str
...
...
lm_eval/tasks/triviaqa/default.yaml
View file @
1d3599a3
...
@@ -21,6 +21,7 @@ filter_list:
...
@@ -21,6 +21,7 @@ filter_list:
filter
:
filter
:
-
function
:
remove_whitespace
-
function
:
remove_whitespace
-
function
:
take_first
-
function
:
take_first
target_delimiter
:
"
"
metric_list
:
metric_list
:
-
metric
:
exact_match
-
metric
:
exact_match
aggregation
:
mean
aggregation
:
mean
...
...
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