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
SIYIXNI
vllm
Commits
67d96c29
"torchvision/csrc/io/image/cpu/decode_jpeg.h" did not exist on "e4b9823f4ad2d752c38d6df4f4b901f97cfafd1a"
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
Show 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(
)
->
Union
[
PreTrainedTokenizer
,
PreTrainedTokenizerFast
]:
"""Gets a tokenizer for the given model name via Huggingface."""
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.
# However, we found that the below LLaMA fast tokenizer works well in
# 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