Skip to content

Commit e1af19d

Browse files
committed
Consider is_cloud_storage when skipping speculator detection
Signed-off-by: Peter Schuurman <[email protected]>
1 parent e7acb20 commit e1af19d

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

vllm/engine/arg_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
is_interleaved,
8181
maybe_override_with_speculators,
8282
)
83-
from vllm.transformers_utils.utils import check_gguf_file, is_s3
83+
from vllm.transformers_utils.utils import check_gguf_file, is_cloud_storage
8484
from vllm.utils.argparse_utils import FlexibleArgumentParser
8585
from vllm.utils.mem_constants import GiB_bytes
8686
from vllm.utils.network_utils import get_ip
@@ -1297,10 +1297,10 @@ def create_engine_config(
12971297

12981298
# Check if the model is a speculator and override model/tokenizer/config
12991299
# BEFORE creating ModelConfig, so the config is created with the target model
1300-
# Skip speculator detection for S3 models since HuggingFace cannot load
1301-
# configs directly from S3 URLs. S3 models can still use speculators with
1302-
# explicit --speculative-config.
1303-
if not is_s3(self.model):
1300+
# Skip speculator detection for cloud storage models (eg: S3, GCS) since
1301+
# HuggingFace cannot load configs directly from S3 URLs. S3 models can still
1302+
# use speculators with explicit --speculative-config.
1303+
if not is_cloud_storage(self.model):
13041304
(self.model, self.tokenizer, self.speculative_config) = (
13051305
maybe_override_with_speculators(
13061306
model=self.model,

vllm/transformers_utils/utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ def is_s3(model_or_path: str) -> bool:
1919
return model_or_path.lower().startswith("s3://")
2020

2121

22+
def is_gcs(model_or_path: str) -> bool:
23+
return model_or_path.lower().startswith("gs://")
24+
25+
26+
def is_cloud_storage(model_or_path: str) -> bool:
27+
return is_s3(model_or_path) or is_gcs(model_or_path)
28+
29+
2230
def check_gguf_file(model: str | PathLike) -> bool:
2331
"""Check if the file is a GGUF model."""
2432
model = Path(model)

0 commit comments

Comments
 (0)