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
67d96c29
Unverified
Commit
67d96c29
authored
Jun 19, 2023
by
Woosuk Kwon
Committed by
GitHub
Jun 20, 2023
Browse files
Use slow tokenizer for open llama models (#168)
parent
033f5c78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
vllm/engine/tokenizer_utils.py
vllm/engine/tokenizer_utils.py
+6
-1
No files found.
vllm/engine/tokenizer_utils.py
View file @
67d96c29
...
@@ -17,7 +17,12 @@ def get_tokenizer(
...
@@ -17,7 +17,12 @@ def get_tokenizer(
)
->
Union
[
PreTrainedTokenizer
,
PreTrainedTokenizerFast
]:
)
->
Union
[
PreTrainedTokenizer
,
PreTrainedTokenizerFast
]:
"""Gets a tokenizer for the given model name via Huggingface."""
"""Gets a tokenizer for the given model name via Huggingface."""
config
=
AutoConfig
.
from_pretrained
(
model_name
)
config
=
AutoConfig
.
from_pretrained
(
model_name
)
if
config
.
model_type
==
"llama"
and
getattr
(
kwargs
,
"use_fast"
,
True
):
if
"open_llama"
in
model_name
:
kwargs
[
"use_fast"
]
=
False
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
):
# LLaMA fast tokenizer causes protobuf errors in some environments.
# LLaMA fast tokenizer causes protobuf errors in some environments.
# However, we found that the below LLaMA fast tokenizer works well in
# However, we found that the below LLaMA fast tokenizer works well in
# most environments.
# most environments.
...
...
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