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
a784417a
Commit
a784417a
authored
Jan 06, 2024
by
daniel-furman
Browse files
first stab at wrap_chat_template, strip error fix
parent
38248282
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
lm_eval/models/huggingface.py
lm_eval/models/huggingface.py
+6
-6
No files found.
lm_eval/models/huggingface.py
View file @
a784417a
...
...
@@ -667,17 +667,17 @@ class HFLM(LM):
new_reqs
=
[]
for
req
in
requests
:
context
,
continuation
=
req
.
args
[
0
],
req
.
args
[
1
]
context
,
continuation
=
req
.
args
[
0
]
.
strip
()
,
req
.
args
[
1
]
.
strip
()
if
system
:
chat
=
[
{
"role"
:
"system"
,
"content"
:
system
.
strip
()
},
{
"role"
:
"user"
,
"content"
:
context
.
strip
()
},
{
"role"
:
"assistant"
,
"content"
:
continuation
.
strip
()
},
{
"role"
:
"system"
,
"content"
:
system
},
{
"role"
:
"user"
,
"content"
:
context
},
{
"role"
:
"assistant"
,
"content"
:
continuation
},
]
else
:
chat
=
[
{
"role"
:
"user"
,
"content"
:
context
.
strip
()
},
{
"role"
:
"assistant"
,
"content"
:
continuation
.
strip
()
},
{
"role"
:
"user"
,
"content"
:
context
},
{
"role"
:
"assistant"
,
"content"
:
continuation
},
]
single_tokenized_conversation
=
self
.
tokenizer
.
apply_chat_template
(
chat
,
...
...
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