Skip to content

Commit 49836f7

Browse files
authored
Merge pull request #1218 from vespa-engine/thomasht86/no-model-url-validation-default
Thomasht86/no model url validation default
2 parents 97326de + e4068bc commit 49836f7

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

tests/unit/test_models.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,14 +2067,20 @@ def test_hf_model_urls_are_valid(self, model_name):
20672067
HF_MODELS entry return HTTP 200 status codes.
20682068
"""
20692069
config = HF_MODELS[model_name]
2070-
# URL validation happens in __post_init__, so if we get here without
2071-
# an exception, the URLs are valid. But let's also verify the config
2072-
# has the expected URLs set.
2073-
print(f"Validating URLs for model: {model_name}")
2070+
2071+
# Verify config has URLs set
20742072
assert config.model_url is not None, f"{model_name} should have model_url"
20752073
assert (
20762074
config.tokenizer_url is not None
20772075
), f"{model_name} should have tokenizer_url"
2078-
assert (
2079-
config.validate_urls is True
2080-
), f"{model_name} should have validate_urls=True"
2076+
2077+
# Explicitly validate URLs by creating a new config with validation enabled
2078+
# (HF_MODELS uses validate_urls=False by default for fast import)
2079+
print(f"Validating URLs for model: {model_name}")
2080+
ModelConfig(
2081+
model_id=config.model_id,
2082+
embedding_dim=config.embedding_dim,
2083+
model_url=config.model_url,
2084+
tokenizer_url=config.tokenizer_url,
2085+
validate_urls=True, # Explicitly enable validation
2086+
)

vespa/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class ModelConfig:
131131
Optional, if not set the Vespa embedder uses its internal default (False).
132132
query_prepend: Optional instruction to prepend to query text
133133
document_prepend: Optional instruction to prepend to document text
134-
validate_urls: Whether to validate URLs by checking they return HTTP 200 (default: True)
134+
validate_urls: Whether to validate URLs by checking they return HTTP 200 (default: False)
135135
"""
136136

137137
model_id: str
@@ -154,7 +154,7 @@ class ModelConfig:
154154
normalize: Optional[bool] = None
155155
query_prepend: Optional[str] = None
156156
document_prepend: Optional[str] = None
157-
validate_urls: bool = True
157+
validate_urls: bool = False
158158
config_hash: str = field(default="", init=False)
159159

160160
def __post_init__(self):

0 commit comments

Comments
 (0)