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
552b09e0
Unverified
Commit
552b09e0
authored
Jul 10, 2023
by
Lintang Sutawika
Committed by
GitHub
Jul 10, 2023
Browse files
template aliase process update.
parent
9383f49e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
lm_eval/api/task.py
lm_eval/api/task.py
+6
-3
No files found.
lm_eval/api/task.py
View file @
552b09e0
...
@@ -64,9 +64,10 @@ class TaskConfig(dict):
...
@@ -64,9 +64,10 @@ class TaskConfig(dict):
fewshot_split
:
str
=
None
# TODO: assert that this not None if num_fewshot > 0. (?) assert if this is same split as one evaling (?)
fewshot_split
:
str
=
None
# TODO: assert that this not None if num_fewshot > 0. (?) assert if this is same split as one evaling (?)
# formatting / prompting options.
# formatting / prompting options.
# see docs/advanced_task_guide.md for more info
# see docs/advanced_task_guide.md for more info
template_aliases
:
str
=
None
template_aliases
:
Union
[
str
,
list
]
=
None
doc_to_text
:
Union
[
Callable
,
str
]
=
None
doc_to_text
:
Union
[
Callable
,
str
]
=
None
doc_to_target
:
Union
[
Callable
,
str
]
=
None
doc_to_target
:
Union
[
Callable
,
str
]
=
None
doc_to_choice
:
Union
[
Callable
,
str
]
=
None
gold_alias
:
Union
[
Callable
,
str
]
=
None
gold_alias
:
Union
[
Callable
,
str
]
=
None
use_prompt
:
str
=
None
use_prompt
:
str
=
None
description
:
str
=
""
description
:
str
=
""
...
@@ -76,8 +77,6 @@ class TaskConfig(dict):
...
@@ -76,8 +77,6 @@ class TaskConfig(dict):
num_fewshot
:
int
=
0
num_fewshot
:
int
=
0
# scoring options
# scoring options
metric_list
:
str
=
None
metric_list
:
str
=
None
gold_alias
:
Union
[
Callable
,
str
]
=
None
create_choices
:
Union
[
Callable
,
str
]
=
None
output_type
:
str
=
"greedy_until"
output_type
:
str
=
"greedy_until"
generation_kwargs
:
dict
=
None
generation_kwargs
:
dict
=
None
repeats
:
int
=
1
repeats
:
int
=
1
...
@@ -628,6 +627,10 @@ class ConfigurableTask(Task):
...
@@ -628,6 +627,10 @@ class ConfigurableTask(Task):
list
(
self
.
fewshot_docs
()),
self
,
rnd
=
random
.
Random
()
list
(
self
.
fewshot_docs
()),
self
,
rnd
=
random
.
Random
()
)
)
if
self
.
_config
.
template_aliases
is
not
None
:
for
key
,
alias
in
self
.
_config
.
template_aliases
:
self
.
dataset
.
rename_column
(
key
,
alias
)
def
__post_init__
(
self
):
def
__post_init__
(
self
):
...
...
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