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
e6897273
Commit
e6897273
authored
Jan 09, 2024
by
daniel-furman
Browse files
first stab at wrap_chat_template, remove special chars from continuation
parent
5c4d9c72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
lm_eval/models/huggingface.py
lm_eval/models/huggingface.py
+2
-0
No files found.
lm_eval/models/huggingface.py
View file @
e6897273
...
@@ -683,6 +683,8 @@ class HFLM(LM):
...
@@ -683,6 +683,8 @@ class HFLM(LM):
rfind_continuation
=
single_tokenized_conversation
.
rfind
(
continuation
)
rfind_continuation
=
single_tokenized_conversation
.
rfind
(
continuation
)
context
=
single_tokenized_conversation
[:
rfind_continuation
]
context
=
single_tokenized_conversation
[:
rfind_continuation
]
continuation
=
single_tokenized_conversation
[
rfind_continuation
:]
continuation
=
single_tokenized_conversation
[
rfind_continuation
:]
# remove special chars from continuation
continuation
=
self
.
tokenizer
.
decode
(
self
.
tokenizer
.
encode
(
continuation
),
skip_special_tokens
=
True
)
req
.
args
=
(
context
,
continuation
)
req
.
args
=
(
context
,
continuation
)
new_reqs
.
append
(
req
)
new_reqs
.
append
(
req
)
...
...
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