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
67a990e7
Unverified
Commit
67a990e7
authored
Jul 01, 2024
by
Hailey Schoelkopf
Committed by
GitHub
Jul 02, 2024
Browse files
update gemma-2 default BOS behavior (#2049)
parent
9088a68f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
lm_eval/models/huggingface.py
lm_eval/models/huggingface.py
+1
-2
lm_eval/models/vllm_causallms.py
lm_eval/models/vllm_causallms.py
+1
-1
No files found.
lm_eval/models/huggingface.py
View file @
67a990e7
...
...
@@ -256,9 +256,8 @@ class HFLM(TemplateLM):
# select (or create) a pad token to use
self
.
tokenizer
=
configure_pad_token
(
self
.
tokenizer
,
model_config
=
self
.
config
)
# TODO: override this for Gemma
self
.
add_bos_token
=
add_bos_token
if
getattr
(
self
.
config
,
"model_type"
,
None
)
==
"gemma"
:
if
getattr
(
self
.
config
,
"model_type"
,
None
)
in
[
"gemma"
,
"gemma2"
]
:
self
.
add_bos_token
=
True
eval_logger
.
info
(
f
"Model type is '
{
self
.
config
.
model_type
}
', a BOS token will be used as Gemma underperforms without it."
...
...
lm_eval/models/vllm_causallms.py
View file @
67a990e7
...
...
@@ -125,7 +125,7 @@ class VLLM(TemplateLM):
if
"gemma"
in
pretrained
.
lower
():
self
.
add_bos_token
=
True
eval_logger
.
info
(
"Found 'gemma' in model name, a BOS token will be used as Gemma underperform
s
without it."
"Found 'gemma' in model name, a BOS token will be used as Gemma
series models
underperform without it."
)
self
.
custom_prefix_token_id
=
prefix_token_id
...
...
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