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
7350958b
Commit
7350958b
authored
May 10, 2024
by
lintangsutawika
Browse files
fixed info log
parent
13203943
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
lm_eval/api/task.py
lm_eval/api/task.py
+14
-1
No files found.
lm_eval/api/task.py
View file @
7350958b
...
@@ -109,6 +109,8 @@ class ConfigurableGroup(abc.ABC):
...
@@ -109,6 +109,8 @@ class ConfigurableGroup(abc.ABC):
self
,
self
,
config
:
Optional
[
dict
]
=
None
,
config
:
Optional
[
dict
]
=
None
,
)
->
None
:
)
->
None
:
# Create a unique identifier ID
self
.
_task_id
=
str
(
uuid
.
uuid1
())
self
.
_config
=
GroupConfig
(
**
config
)
self
.
_config
=
GroupConfig
(
**
config
)
@
property
@
property
...
@@ -127,6 +129,10 @@ class ConfigurableGroup(abc.ABC):
...
@@ -127,6 +129,10 @@ class ConfigurableGroup(abc.ABC):
def
config
(
self
):
def
config
(
self
):
return
self
.
_config
.
to_dict
()
return
self
.
_config
.
to_dict
()
@
property
def
task_id
(
self
)
->
Any
:
return
self
.
_task_id
def
__repr__
(
self
):
def
__repr__
(
self
):
return
(
return
(
f
"ConfigurableGroup(group=
{
self
.
group
}
,"
f
"group_alias=
{
self
.
group_alias
}
)"
f
"ConfigurableGroup(group=
{
self
.
group
}
,"
f
"group_alias=
{
self
.
group_alias
}
)"
...
@@ -762,6 +768,9 @@ class ConfigurableTask(Task):
...
@@ -762,6 +768,9 @@ class ConfigurableTask(Task):
download_mode
=
None
,
download_mode
=
None
,
config
:
Optional
[
dict
]
=
None
,
config
:
Optional
[
dict
]
=
None
,
)
->
None
:
# TODO no super() call here
)
->
None
:
# TODO no super() call here
# Create a unique identifier ID
self
.
_task_id
=
str
(
uuid
.
uuid1
())
# Get pre-configured attributes
# Get pre-configured attributes
self
.
_config
=
self
.
CONFIG
self
.
_config
=
self
.
CONFIG
...
@@ -1034,7 +1043,7 @@ class ConfigurableTask(Task):
...
@@ -1034,7 +1043,7 @@ class ConfigurableTask(Task):
else
:
else
:
if
(
self
.
config
.
num_fewshot
is
not
None
)
and
(
self
.
config
.
num_fewshot
>
0
):
if
(
self
.
config
.
num_fewshot
is
not
None
)
and
(
self
.
config
.
num_fewshot
>
0
):
eval_logger
.
warning
(
eval_logger
.
warning
(
f
"Task
'
{
self
.
config
.
task
}
':
"
f
"
[
Task
:
{
self
.
config
.
task
}
]
"
"num_fewshot > 0 but fewshot_split is None. "
"num_fewshot > 0 but fewshot_split is None. "
"using preconfigured rule."
"using preconfigured rule."
)
)
...
@@ -1477,6 +1486,10 @@ class ConfigurableTask(Task):
...
@@ -1477,6 +1486,10 @@ class ConfigurableTask(Task):
def
get_config
(
self
,
key
:
str
)
->
Any
:
def
get_config
(
self
,
key
:
str
)
->
Any
:
return
getattr
(
self
.
_config
,
key
,
None
)
return
getattr
(
self
.
_config
,
key
,
None
)
@
property
def
task_id
(
self
)
->
Any
:
return
self
.
_task_id
def
__repr__
(
self
):
def
__repr__
(
self
):
return
(
return
(
f
"ConfigurableTask(task_name=
{
getattr
(
self
.
config
,
'task'
,
None
)
}
,"
f
"ConfigurableTask(task_name=
{
getattr
(
self
.
config
,
'task'
,
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