Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Misc] Prevent vLLM from searching for files on the hub when the model is a local path #13292

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions vllm/transformers_utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ def file_exists(
# In offline mode the result can be a false negative
def file_or_path_exists(model: Union[str, Path], config_name: str,
revision: Optional[str]) -> bool:
if Path(model).exists():
return (Path(model) / config_name).is_file()
if (local_path := Path(model)).exists():
return (local_path / config_name).is_file()

# Offline mode support: Check if config file is cached already
cached_filepath = try_to_load_from_cache(repo_id=model,
Expand Down Expand Up @@ -492,7 +492,7 @@ def get_sentence_transformer_tokenizer_config(model: str,
if encoder_dict:
break

if not encoder_dict:
if not encoder_dict and not Path(model).exists():
try:
# If model is on HuggingfaceHub, get the repo files
repo_files = list_repo_files(model,
Expand Down