[Frontend] Perform offline path replacement to tokenizer (#29706)
Signed-off-by: Tsukasa OI <floss_llm@irq.a4lg.com>
This commit is contained in:
@@ -581,15 +581,26 @@ class EngineArgs:
|
||||
from vllm.plugins import load_general_plugins
|
||||
|
||||
load_general_plugins()
|
||||
# when use hf offline,replace model id to local model path
|
||||
# when use hf offline,replace model and tokenizer id to local model path
|
||||
if huggingface_hub.constants.HF_HUB_OFFLINE:
|
||||
model_id = self.model
|
||||
self.model = get_model_path(self.model, self.revision)
|
||||
logger.info(
|
||||
"HF_HUB_OFFLINE is True, replace model_id [%s] to model_path [%s]",
|
||||
model_id,
|
||||
self.model,
|
||||
)
|
||||
if model_id is not self.model:
|
||||
logger.info(
|
||||
"HF_HUB_OFFLINE is True, replace model_id [%s] to model_path [%s]",
|
||||
model_id,
|
||||
self.model,
|
||||
)
|
||||
if self.tokenizer is not None:
|
||||
tokenizer_id = self.tokenizer
|
||||
self.tokenizer = get_model_path(self.tokenizer, self.tokenizer_revision)
|
||||
if tokenizer_id is not self.tokenizer:
|
||||
logger.info(
|
||||
"HF_HUB_OFFLINE is True, replace tokenizer_id [%s] "
|
||||
"to tokenizer_path [%s]",
|
||||
tokenizer_id,
|
||||
self.tokenizer,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def add_cli_args(parser: FlexibleArgumentParser) -> FlexibleArgumentParser:
|
||||
|
||||
Reference in New Issue
Block a user