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
e1d5c849
Commit
e1d5c849
authored
Nov 07, 2023
by
lintangsutawika
Browse files
moved squad.py and format changes
parent
8bf55a20
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
+8
-9
lm_eval/api/task.py
lm_eval/api/task.py
+7
-8
lm_eval/tasks/__init__.py
lm_eval/tasks/__init__.py
+1
-1
lm_eval/tasks/squadv2/squad.py
lm_eval/tasks/squadv2/squad.py
+0
-0
No files found.
lm_eval/api/task.py
View file @
e1d5c849
...
...
@@ -208,7 +208,6 @@ class Task(abc.ABC):
TaskConfig
(
{
**
config
,
**
{
"dataset_path"
:
DATASET_PATH
,
"dataset_name"
:
DATASET_NAME
},
}
)
if
config
...
...
@@ -217,7 +216,6 @@ class Task(abc.ABC):
self
.
_filters
=
[
build_filter_ensemble
(
"none"
,
[[
"take_first"
,
None
]])]
def
download
(
self
,
data_dir
=
None
,
cache_dir
=
None
,
download_mode
=
None
)
->
None
:
"""Downloads and returns the task dataset.
Override this method to download the dataset from a custom API.
...
...
@@ -357,9 +355,7 @@ class Task(abc.ABC):
False
),
f
"Task dataset (path=
{
self
.
DATASET_PATH
}
, name=
{
self
.
DATASET_NAME
}
) must have valid or test docs!"
eval_logger
.
info
(
f
"Building contexts for task on rank
{
rank
}
..."
)
eval_logger
.
info
(
f
"Building contexts for task on rank
{
rank
}
..."
)
instances
=
[]
for
doc_id
,
doc
in
utils
.
create_iterator
(
...
...
@@ -450,7 +446,12 @@ class Task(abc.ABC):
@
utils
.
positional_deprecated
def
fewshot_context
(
self
,
doc
,
num_fewshot
,
provide_description
=
None
,
rnd
=
random
.
Random
(
1234
),
description
=
None
self
,
doc
,
num_fewshot
,
provide_description
=
None
,
rnd
=
random
.
Random
(
1234
),
description
=
None
,
):
"""Returns a fewshot context string that is made up of a prepended description
(if provided), the `num_fewshot` number of examples, and an appended prompt example.
...
...
@@ -800,7 +801,6 @@ class ConfigurableTask(Task):
)
return
super
().
fewshot_docs
()
@
utils
.
positional_deprecated
def
fewshot_context
(
self
,
doc
,
num_fewshot
):
"""Returns a fewshot context string that is made up of a prepended description
...
...
@@ -834,7 +834,6 @@ class ConfigurableTask(Task):
else
:
return
labeled_examples
+
str
(
example
)
def
apply_filters
(
self
):
if
hasattr
(
self
,
"_filters"
):
for
f
in
self
.
_filters
:
...
...
lm_eval/tasks/__init__.py
View file @
e1d5c849
...
...
@@ -15,7 +15,7 @@ from lm_eval.api.registry import (
import
logging
from
.squad
import
SQuAD2
from
.squadv2
.squad
import
SQuAD2
eval_logger
=
logging
.
getLogger
(
"lm-eval"
)
...
...
lm_eval/tasks/squad.py
→
lm_eval/tasks/
squadv2/
squad.py
View file @
e1d5c849
File moved
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