From eceabd407503f576d4bdde52c9b377cb0a03ed9c Mon Sep 17 00:00:00 2001 From: "mulin.lyh" Date: Mon, 3 Jun 2024 22:14:59 +0800 Subject: [PATCH] set tokenizer version --- vllm/config.py | 6 +++++- vllm/engine/llm_engine.py | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/vllm/config.py b/vllm/config.py index eee62d2683835..470d77fca01cd 100644 --- a/vllm/config.py +++ b/vllm/config.py @@ -112,7 +112,11 @@ def __init__( self.revision = revision self.code_revision = code_revision self.rope_scaling = rope_scaling - self.tokenizer_revision = tokenizer_revision + # The tokenizer version is usually consistent with the model version + if tokenizer_revision is None: + self.tokenizer_revision = revision + else: + self.tokenizer_revision = tokenizer_revision self.quantization = quantization self.quantization_param_path = quantization_param_path self.enforce_eager = enforce_eager diff --git a/vllm/engine/llm_engine.py b/vllm/engine/llm_engine.py index 625dd308a43e6..cb5893e707c8b 100644 --- a/vllm/engine/llm_engine.py +++ b/vllm/engine/llm_engine.py @@ -402,9 +402,7 @@ def _init_tokenizer(self, **tokenizer_init_kwargs) -> BaseTokenizerGroup: max_input_length=None, tokenizer_mode=self.model_config.tokenizer_mode, trust_remote_code=self.model_config.trust_remote_code, - revision=self.model_config.tokenizer_revision - if self.model_config.tokenizer_revision is not None else - self.model_config.revision) + revision=self.model_config.tokenizer_revision) init_kwargs.update(tokenizer_init_kwargs) return get_tokenizer_group(self.parallel_config.tokenizer_pool_config,