fix for gated/private models

This commit is contained in:
Datta Nimmaturi 2026-04-22 03:37:32 +00:00
commit 0129fb5e81
2 changed files with 14 additions and 11 deletions

View file

@ -244,7 +244,6 @@ VLLM_SUPPORTED_VLM = [
"gemma3", "gemma3",
"mistral3", "mistral3",
"qwen3_vl", "qwen3_vl",
"qwen3_5",
"qwen3_vl_moe", "qwen3_vl_moe",
] ]
VLLM_NON_LORA_VLM = [ VLLM_NON_LORA_VLM = [

View file

@ -258,7 +258,7 @@ def check_if_sentencepiece_model(
return sentencepiece_model return sentencepiece_model
_TOKENIZER_MODEL_CACHE = {} _TOKENIZER_MODEL_CACHE = set()
def _has_tokenizer_model(tokenizer, token = None): def _has_tokenizer_model(tokenizer, token = None):
@ -271,16 +271,20 @@ def _has_tokenizer_model(tokenizer, token = None):
return False return False
if os.path.isdir(source): if os.path.isdir(source):
return os.path.isfile(os.path.join(source, "tokenizer.model")) return os.path.isfile(os.path.join(source, "tokenizer.model"))
if source in _TOKENIZER_MODEL_CACHE:
return True
if source not in _TOKENIZER_MODEL_CACHE: try:
try: repo_info = HfApi(token = token).model_info(source, files_metadata = False)
repo_info = HfApi(token = token).model_info(source, files_metadata = False) except Exception:
_TOKENIZER_MODEL_CACHE[source] = any( return False
sibling.rfilename == "tokenizer.model" for sibling in repo_info.siblings
) has_tokenizer_model = any(
except Exception: sibling.rfilename == "tokenizer.model" for sibling in repo_info.siblings
_TOKENIZER_MODEL_CACHE[source] = False )
return _TOKENIZER_MODEL_CACHE[source] if has_tokenizer_model:
_TOKENIZER_MODEL_CACHE.add(source)
return has_tokenizer_model
def _preserve_sentencepiece_tokenizer_assets( def _preserve_sentencepiece_tokenizer_assets(