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
da92dc8c
"models/vision/glide/run_dalle2.py" did not exist on "f15f0cd2b50df9823c295f82f5f3e7fc8bf2cdcf"
Commit
da92dc8c
authored
Jan 02, 2025
by
Baber
Browse files
nit
parent
523243d2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
lm_eval/tasks/llama3/instruct/mgsm/utils.py
lm_eval/tasks/llama3/instruct/mgsm/utils.py
+7
-1
No files found.
lm_eval/tasks/llama3/instruct/mgsm/utils.py
View file @
da92dc8c
import
re
import
string
import
string
from
functools
import
partial
from
functools
import
partial
from
typing
import
TYPE_CHECKING
,
Dict
,
List
from
typing
import
TYPE_CHECKING
,
Dict
,
List
...
@@ -83,7 +84,12 @@ def number_variations(n: int) -> List[str]:
...
@@ -83,7 +84,12 @@ def number_variations(n: int) -> List[str]:
def
process_docs
(
lang
:
str
,
df
:
"datasets.Dataset"
)
->
"datasets.Dataset"
:
def
process_docs
(
lang
:
str
,
df
:
"datasets.Dataset"
)
->
"datasets.Dataset"
:
def
map_
(
doc
:
dict
):
def
map_
(
doc
:
dict
):
suffix
=
[
x
for
x
in
PROMPTS
if
x
[
"subtask_name"
]
==
lang
][
0
][
"rep"
]
suffix
=
[
x
for
x
in
PROMPTS
if
x
[
"subtask_name"
]
==
lang
][
0
][
"rep"
]
doc
[
"question"
]
=
suffix
+
"
\n\n
"
+
doc
[
"question"
].
split
(
":"
,
1
)[
-
1
]
doc
[
"question"
]
=
(
suffix
+
"
\n\n
"
+
re
.
split
(
"[:|:]"
,
doc
[
"question"
],
maxsplit
=
1
)[
-
1
].
strip
()
)
doc
[
"answers"
]
=
number_variations
(
doc
[
"answer_number"
])
doc
[
"answers"
]
=
number_variations
(
doc
[
"answer_number"
])
return
doc
return
doc
...
...
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