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
d762e2aa
Commit
d762e2aa
authored
Jul 25, 2025
by
Baber
Browse files
fix
parent
7a8203fa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
lm_eval/__main__.py
lm_eval/__main__.py
+5
-0
lm_eval/api/task.py
lm_eval/api/task.py
+11
-2
No files found.
lm_eval/__main__.py
View file @
d762e2aa
from
rich.traceback
import
install
from
lm_eval._cli.harness
import
HarnessCLI
from
lm_eval._cli.harness
import
HarnessCLI
from
lm_eval.utils
import
setup_logging
from
lm_eval.utils
import
setup_logging
install
(
show_locals
=
True
)
def
cli_evaluate
()
->
None
:
def
cli_evaluate
()
->
None
:
"""Main CLI entry point."""
"""Main CLI entry point."""
setup_logging
()
setup_logging
()
...
...
lm_eval/api/task.py
View file @
d762e2aa
...
@@ -660,6 +660,8 @@ class ConfigurableTask(Task):
...
@@ -660,6 +660,8 @@ class ConfigurableTask(Task):
if
hasattr
(
self
,
_method
):
if
hasattr
(
self
,
_method
):
setattr
(
self
,
_method
,
MethodType
(
fn
,
self
))
setattr
(
self
,
_method
,
MethodType
(
fn
,
self
))
self
.
runtime_checks
(
self
.
task_docs
[
0
])
print
(
"hello"
)
print
(
"hello"
)
def
download
(
self
,
dataset_kwargs
:
dict
[
str
,
Any
]
|
None
=
None
,
**
kwargs
)
->
None
:
def
download
(
self
,
dataset_kwargs
:
dict
[
str
,
Any
]
|
None
=
None
,
**
kwargs
)
->
None
:
...
@@ -1427,6 +1429,7 @@ class ConfigurableTask(Task):
...
@@ -1427,6 +1429,7 @@ class ConfigurableTask(Task):
# Test One Doc
# Test One Doc
self
.
features
:
list
[
str
]
=
list
(
self
.
task_docs
.
features
.
keys
())
self
.
features
:
list
[
str
]
=
list
(
self
.
task_docs
.
features
.
keys
())
self
.
multiple_target
=
0
self
.
multiple_target
=
0
self
.
multiple_input
=
0
test_text
=
self
.
doc_to_text
(
test_doc
)
test_text
=
self
.
doc_to_text
(
test_doc
)
test_target
=
self
.
doc_to_target
(
test_doc
)
test_target
=
self
.
doc_to_target
(
test_doc
)
...
@@ -1434,13 +1437,19 @@ class ConfigurableTask(Task):
...
@@ -1434,13 +1437,19 @@ class ConfigurableTask(Task):
test_choice
=
self
.
doc_to_choice
(
test_doc
)
test_choice
=
self
.
doc_to_choice
(
test_doc
)
if
not
isinstance
(
test_choice
,
list
):
if
not
isinstance
(
test_choice
,
list
):
eval_logger
.
error
(
"doc_to_choice must return list"
)
eval_logger
.
error
(
"doc_to_choice must return list"
)
# else:
else
:
# num_choice = len(test_choice)
num_choice
=
len
(
test_choice
)
if
isinstance
(
test_text
,
int
):
eval_logger
.
debug
(
"doc_to_text returned an int. Assuming multiple inputs."
)
if
isinstance
(
test_text
,
int
):
if
isinstance
(
test_text
,
int
):
eval_logger
.
debug
(
eval_logger
.
debug
(
"doc_to_text returned an int. Assuming multiple inputs."
"doc_to_text returned an int. Assuming multiple inputs."
)
)
self
.
multiple_input
=
num_choice
else
:
else
:
test_choice
=
None
test_choice
=
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