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
9db56820
Commit
9db56820
authored
Oct 15, 2025
by
Baber
Browse files
`self.tokenizer.bos_token` can be None
parent
03f6ad01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
lm_eval/models/vllm_causallms.py
lm_eval/models/vllm_causallms.py
+5
-3
No files found.
lm_eval/models/vllm_causallms.py
View file @
9db56820
...
@@ -21,6 +21,7 @@ from lm_eval.api.model import TemplateLM
...
@@ -21,6 +21,7 @@ from lm_eval.api.model import TemplateLM
from
lm_eval.api.registry
import
register_model
from
lm_eval.api.registry
import
register_model
from
lm_eval.models.utils
import
(
from
lm_eval.models.utils
import
(
Collator
,
Collator
,
bos_already_added
,
configure_pad_token
,
configure_pad_token
,
handle_stop_sequences
,
handle_stop_sequences
,
postprocess_generated_text
,
postprocess_generated_text
,
...
@@ -349,10 +350,11 @@ class VLLM(TemplateLM):
...
@@ -349,10 +350,11 @@ class VLLM(TemplateLM):
else
{}
else
{}
)
)
# handle chat template
# handle chat template
if
self
.
tokenizer
.
bos_token
and
(
if
bos_already_added
(
string
[
0
]
if
isinstance
(
string
,
list
)
else
string
string
[
0
]
if
isinstance
(
string
,
list
)
else
string
,
self
.
tokenizer
.
bos_token
).
startswith
(
self
.
tokenizer
.
bos_token
):
):
add_special_kwargs
=
{
"add_special_tokens"
:
False
}
add_special_kwargs
=
{
"add_special_tokens"
:
False
}
encoding
:
list
[
list
[
int
]]
|
list
[
int
]
=
self
.
tokenizer
(
encoding
:
list
[
list
[
int
]]
|
list
[
int
]
=
self
.
tokenizer
(
string
,
string
,
truncation
=
truncation
,
truncation
=
truncation
,
...
...
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