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
977817a0
Commit
977817a0
authored
Jun 21, 2023
by
lintangsutawika
Browse files
made two delimiter modes
parent
3c805576
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
lm_eval/api/samplers.py
lm_eval/api/samplers.py
+3
-1
lm_eval/api/task.py
lm_eval/api/task.py
+2
-1
No files found.
lm_eval/api/samplers.py
View file @
977817a0
...
@@ -33,7 +33,9 @@ class Sampler:
...
@@ -33,7 +33,9 @@ class Sampler:
self
.
delimiter
.
join
(
self
.
delimiter
.
join
(
[
[
# TODO: is separating doc_to_text and doc_to_target by one space always desired?
# TODO: is separating doc_to_text and doc_to_target by one space always desired?
self
.
task
.
doc_to_text
(
doc
)
+
" "
+
self
.
task
.
doc_to_target
(
doc
)
self
.
task
.
doc_to_text
(
doc
)
+
self
.
config
.
sample_delimiter
+
self
.
task
.
doc_to_target
(
doc
)
for
doc
in
selected_docs
for
doc
in
selected_docs
]
]
)
)
...
...
lm_eval/api/task.py
View file @
977817a0
...
@@ -76,7 +76,8 @@ class TaskConfig(dict):
...
@@ -76,7 +76,8 @@ class TaskConfig(dict):
gold_alias
:
Union
[
Callable
,
str
]
=
None
gold_alias
:
Union
[
Callable
,
str
]
=
None
output_type
:
str
=
"greedy_until"
output_type
:
str
=
"greedy_until"
generation_kwargs
:
dict
=
None
generation_kwargs
:
dict
=
None
delimiter
:
str
=
"
\n\n
"
target_delimiter
:
str
=
"
\n\n
"
sample_delimiter
:
str
=
" "
filter_list
:
Union
[
str
,
list
]
=
None
filter_list
:
Union
[
str
,
list
]
=
None
should_decontaminate
:
bool
=
False
should_decontaminate
:
bool
=
False
doc_to_decontamination_query
:
str
=
None
doc_to_decontamination_query
:
str
=
None
...
...
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