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
1ef5b0bf
"vscode:/vscode.git/clone" did not exist on "c5e3bad98d877a888e8d11f390371757baf094aa"
Commit
1ef5b0bf
authored
May 11, 2024
by
lintangsutawika
Browse files
add task_id for python tasks as well
parent
78c3f7d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
lm_eval/api/task.py
lm_eval/api/task.py
+5
-0
lm_eval/tasks/__init__.py
lm_eval/tasks/__init__.py
+0
-2
No files found.
lm_eval/api/task.py
View file @
1ef5b0bf
...
@@ -316,6 +316,8 @@ class Task(abc.ABC):
...
@@ -316,6 +316,8 @@ class Task(abc.ABC):
self
.
_fewshot_docs
:
Optional
[
list
]
=
None
self
.
_fewshot_docs
:
Optional
[
list
]
=
None
self
.
_instances
:
Optional
[
List
[
Instance
]]
=
None
self
.
_instances
:
Optional
[
List
[
Instance
]]
=
None
# Create a unique identifier ID
self
.
_task_id
=
str
(
uuid
.
uuid1
())
self
.
_config
:
TaskConfig
=
TaskConfig
({
**
config
})
if
config
else
TaskConfig
()
self
.
_config
:
TaskConfig
=
TaskConfig
({
**
config
})
if
config
else
TaskConfig
()
self
.
_filters
=
[
build_filter_ensemble
(
"none"
,
[[
"take_first"
,
None
]])]
self
.
_filters
=
[
build_filter_ensemble
(
"none"
,
[[
"take_first"
,
None
]])]
...
@@ -756,6 +758,9 @@ class Task(abc.ABC):
...
@@ -756,6 +758,9 @@ class Task(abc.ABC):
)
)
return
doc_iterator
return
doc_iterator
@
property
def
task_id
(
self
)
->
Any
:
return
self
.
_task_id
class
ConfigurableTask
(
Task
):
class
ConfigurableTask
(
Task
):
VERSION
=
"Yaml"
VERSION
=
"Yaml"
...
...
lm_eval/tasks/__init__.py
View file @
1ef5b0bf
...
@@ -256,8 +256,6 @@ class TaskManager:
...
@@ -256,8 +256,6 @@ class TaskManager:
group_name
:
dict
(
collections
.
ChainMap
(
*
map
(
fn
,
reversed
(
subtask_list
))))
group_name
:
dict
(
collections
.
ChainMap
(
*
map
(
fn
,
reversed
(
subtask_list
))))
}
}
def
build_tasks
def
load_task_or_group
(
self
,
task_list
:
Optional
[
Union
[
str
,
list
]]
=
None
)
->
dict
:
def
load_task_or_group
(
self
,
task_list
:
Optional
[
Union
[
str
,
list
]]
=
None
)
->
dict
:
"""Loads a dictionary of task objects from a list
"""Loads a dictionary of task objects from a list
...
...
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