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
e162dc46
"magic_pdf/git@developer.sourcefind.cn:wangsen/mineru.git" did not exist on "9fee2ce09f1404a212a00c2de29ef6b075988c1a"
Commit
e162dc46
authored
Apr 26, 2024
by
haileyschoelkopf
Browse files
run linters
parent
197594f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
lm_eval/tasks/fda/task.py
lm_eval/tasks/fda/task.py
+2
-2
lm_eval/tasks/squad_completion/task.py
lm_eval/tasks/squad_completion/task.py
+2
-2
lm_eval/tasks/swde/task.py
lm_eval/tasks/swde/task.py
+2
-2
No files found.
lm_eval/tasks/fda/task.py
View file @
e162dc46
...
@@ -34,7 +34,7 @@ class FDA(ConfigurableTask):
...
@@ -34,7 +34,7 @@ class FDA(ConfigurableTask):
def
doc_to_target
(
self
,
doc
):
def
doc_to_target
(
self
,
doc
):
return
doc
[
"value"
]
return
doc
[
"value"
]
def
construct_requests
(
self
,
doc
,
ctx
,
**
kwargs
):
def
construct_requests
(
self
,
doc
,
ctx
,
**
kwargs
):
"""Uses RequestFactory to construct Requests and returns an iterable of
"""Uses RequestFactory to construct Requests and returns an iterable of
Requests which will be sent to the LM.
Requests which will be sent to the LM.
...
@@ -93,7 +93,7 @@ class FDA(ConfigurableTask):
...
@@ -93,7 +93,7 @@ class FDA(ConfigurableTask):
return
{
return
{
"contains"
:
True
,
# Exact match (the normalized answer exactly match the gold answer
"contains"
:
True
,
# Exact match (the normalized answer exactly match the gold answer
}
}
def
contains_score
(
prediction
:
str
,
labels
:
List
[
str
]):
def
contains_score
(
prediction
:
str
,
labels
:
List
[
str
]):
return
max
(
return
max
(
...
...
lm_eval/tasks/squad_completion/task.py
View file @
e162dc46
...
@@ -34,7 +34,7 @@ class SQUADCompletion(ConfigurableTask):
...
@@ -34,7 +34,7 @@ class SQUADCompletion(ConfigurableTask):
def
doc_to_target
(
self
,
doc
):
def
doc_to_target
(
self
,
doc
):
return
doc
[
"value"
]
return
doc
[
"value"
]
def
construct_requests
(
self
,
doc
,
ctx
,
**
kwargs
):
def
construct_requests
(
self
,
doc
,
ctx
,
**
kwargs
):
"""Uses RequestFactory to construct Requests and returns an iterable of
"""Uses RequestFactory to construct Requests and returns an iterable of
Requests which will be sent to the LM.
Requests which will be sent to the LM.
...
@@ -93,7 +93,7 @@ class SQUADCompletion(ConfigurableTask):
...
@@ -93,7 +93,7 @@ class SQUADCompletion(ConfigurableTask):
return
{
return
{
"contains"
:
True
,
# Exact match (the normalized answer exactly match the gold answer
"contains"
:
True
,
# Exact match (the normalized answer exactly match the gold answer
}
}
def
contains_score
(
prediction
:
str
,
labels
:
List
[
str
]):
def
contains_score
(
prediction
:
str
,
labels
:
List
[
str
]):
return
max
(
return
max
(
...
...
lm_eval/tasks/swde/task.py
View file @
e162dc46
...
@@ -38,7 +38,7 @@ class SWDE(ConfigurableTask):
...
@@ -38,7 +38,7 @@ class SWDE(ConfigurableTask):
def
doc_to_target
(
self
,
doc
):
def
doc_to_target
(
self
,
doc
):
return
doc
[
"value"
]
return
doc
[
"value"
]
def
construct_requests
(
self
,
doc
,
ctx
,
**
kwargs
):
def
construct_requests
(
self
,
doc
,
ctx
,
**
kwargs
):
"""Uses RequestFactory to construct Requests and returns an iterable of
"""Uses RequestFactory to construct Requests and returns an iterable of
Requests which will be sent to the LM.
Requests which will be sent to the LM.
...
@@ -97,7 +97,7 @@ class SWDE(ConfigurableTask):
...
@@ -97,7 +97,7 @@ class SWDE(ConfigurableTask):
return
{
return
{
"contains"
:
True
,
# Exact match (the normalized answer exactly match the gold answer
"contains"
:
True
,
# Exact match (the normalized answer exactly match the gold answer
}
}
def
contains_score
(
prediction
:
str
,
labels
:
List
[
str
]):
def
contains_score
(
prediction
:
str
,
labels
:
List
[
str
]):
return
max
(
return
max
(
...
...
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