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
norm
vllm
Commits
06033798
Unverified
Commit
06033798
authored
Jun 25, 2023
by
metacryptom
Committed by
GitHub
Jun 24, 2023
Browse files
fix wrong using getattr to get dict value (#232)
parent
665c4896
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
vllm/engine/tokenizer_utils.py
vllm/engine/tokenizer_utils.py
+2
-2
No files found.
vllm/engine/tokenizer_utils.py
View file @
06033798
...
...
@@ -22,7 +22,7 @@ def get_tokenizer(
logger
.
info
(
"OpenLLaMA models do not support the fast tokenizer. "
"Using the slow tokenizer instead."
)
elif
config
.
model_type
==
"llama"
and
getattr
(
kwargs
,
"use_fast"
,
True
):
elif
config
.
model_type
==
"llama"
and
kwargs
.
get
(
"use_fast"
,
True
):
# LLaMA fast tokenizer causes protobuf errors in some environments.
# However, we found that the below LLaMA fast tokenizer works well in
# most environments.
...
...
@@ -31,7 +31,7 @@ def get_tokenizer(
f
"Using the LLaMA fast tokenizer in '
{
model_name
}
' to avoid "
"potential protobuf errors."
)
elif
config
.
model_type
in
_MODEL_TYPES_WITH_SLOW_TOKENIZER
:
if
getattr
(
kwargs
,
"use_fast"
,
False
)
==
True
:
if
kwargs
.
get
(
"use_fast"
,
False
)
==
True
:
raise
ValueError
(
f
"Cannot use the fast tokenizer for
{
config
.
model_type
}
due to "
"bugs in the fast tokenizer."
)
...
...
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