A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 17, 08:00 UTC
fix wrong using getattr to get dict value (#232)
metacryptom committed
Jun 25, 2023 at 13:00 UTC
0603379863cd98aac0b56a32eed49c6f0c8bff46
1 file changed
+2
-2
vllm/engine/tokenizer_utils.py
+2
-2
@@ -22,7 +22,7 @@ def get_tokenizer(
22
logger.info(
23
"OpenLLaMA models do not support the fast tokenizer. "
24
"Using the slow tokenizer instead.")
25
- elif config.model_type == "llama" and getattr(kwargs, "use_fast", True):
25
+ elif config.model_type == "llama" and kwargs.get("use_fast", True):
26
# LLaMA fast tokenizer causes protobuf errors in some environments.
27
# However, we found that the below LLaMA fast tokenizer works well in
28
# most environments.
@@ -31,7 +31,7 @@ def get_tokenizer(
31
f"Using the LLaMA fast tokenizer in '{model_name}' to avoid "
32
"potential protobuf errors.")
33
elif config.model_type in _MODEL_TYPES_WITH_SLOW_TOKENIZER:
34
- if getattr(kwargs, "use_fast", False) == True:
34
+ if kwargs.get("use_fast", False) == True:
35
raise ValueError(
36
f"Cannot use the fast tokenizer for {config.model_type} due to "
37
"bugs in the fast tokenizer.")