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
4288b53e
Commit
4288b53e
authored
Jan 29, 2025
by
Baber
Browse files
Merge branch 'main' into llama
parents
37eb9c9d
94344a61
Changes
201
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
lm_eval/tasks/moral_stories/utils.py
lm_eval/tasks/moral_stories/utils.py
+21
-0
No files found.
lm_eval/tasks/moral_stories/utils.py
0 → 100644
View file @
4288b53e
import
datasets
def
process_docs
(
dataset
:
datasets
.
Dataset
)
->
datasets
.
Dataset
:
def
_process_doc
(
doc
):
ctx
=
(
doc
[
"norm"
].
capitalize
()
+
" "
+
doc
[
"situation"
].
capitalize
()
+
" "
+
doc
[
"intention"
].
capitalize
()
)
choices
=
[
doc
[
"moral_action"
],
doc
[
"immoral_action"
]]
out_doc
=
{
"query"
:
ctx
,
"choices"
:
choices
,
"label"
:
0
,
}
return
out_doc
return
dataset
.
map
(
_process_doc
)
Prev
1
…
7
8
9
10
11
Next
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