fix: propagate revision/code_revision pins to all artifact boundaries (#42616)
Signed-off-by: jperezde <jperezde@redhat.com> Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
This commit is contained in:
co-authored by
Cyrus Leung
parent
d735968f6d
commit
d26a28ab03
@@ -122,14 +122,17 @@ class TestGGUFModelLoader:
|
|||||||
|
|
||||||
mock_hf_download.return_value = "/downloaded/model.gguf"
|
mock_hf_download.return_value = "/downloaded/model.gguf"
|
||||||
|
|
||||||
# Create a simple mock ModelConfig with only the model attribute
|
|
||||||
model_config = MagicMock()
|
model_config = MagicMock()
|
||||||
model_config.model = "unsloth/Qwen3-0.6B-GGUF/model.gguf"
|
model_config.model = "unsloth/Qwen3-0.6B-GGUF/model.gguf"
|
||||||
|
model_config.revision = "abc123"
|
||||||
|
|
||||||
result = loader._prepare_weights(model_config)
|
result = loader._prepare_weights(model_config)
|
||||||
assert result == "/downloaded/model.gguf"
|
assert result == "/downloaded/model.gguf"
|
||||||
mock_hf_download.assert_called_once_with(
|
mock_hf_download.assert_called_once_with(
|
||||||
repo_id="unsloth/Qwen3-0.6B-GGUF", filename="model.gguf"
|
repo_id="unsloth/Qwen3-0.6B-GGUF",
|
||||||
|
filename="model.gguf",
|
||||||
|
revision="abc123",
|
||||||
|
cache_dir=None,
|
||||||
)
|
)
|
||||||
|
|
||||||
@patch("vllm.config.model.get_hf_image_processor_config", return_value=None)
|
@patch("vllm.config.model.get_hf_image_processor_config", return_value=None)
|
||||||
|
|||||||
@@ -57,7 +57,12 @@ class GGUFModelLoader(BaseModelLoader):
|
|||||||
# repo id/filename.gguf
|
# repo id/filename.gguf
|
||||||
if "/" in model_name_or_path and model_name_or_path.endswith(".gguf"):
|
if "/" in model_name_or_path and model_name_or_path.endswith(".gguf"):
|
||||||
repo_id, filename = model_name_or_path.rsplit("/", 1)
|
repo_id, filename = model_name_or_path.rsplit("/", 1)
|
||||||
return hf_hub_download(repo_id=repo_id, filename=filename)
|
return hf_hub_download(
|
||||||
|
repo_id=repo_id,
|
||||||
|
filename=filename,
|
||||||
|
revision=model_config.revision,
|
||||||
|
cache_dir=self.load_config.download_dir,
|
||||||
|
)
|
||||||
# repo_id:quant_type
|
# repo_id:quant_type
|
||||||
elif "/" in model_name_or_path and ":" in model_name_or_path:
|
elif "/" in model_name_or_path and ":" in model_name_or_path:
|
||||||
repo_id, quant_type = model_name_or_path.rsplit(":", 1)
|
repo_id, quant_type = model_name_or_path.rsplit(":", 1)
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ class KimiAudioWhisperEncoder(WhisperEncoder):
|
|||||||
whisper_config = HFWhisperConfig.from_pretrained(
|
whisper_config = HFWhisperConfig.from_pretrained(
|
||||||
model_path,
|
model_path,
|
||||||
subfolder=KIMIA_WHISPER_SUBFOLDER,
|
subfolder=KIMIA_WHISPER_SUBFOLDER,
|
||||||
|
revision=vllm_config.model_config.revision,
|
||||||
)
|
)
|
||||||
|
|
||||||
super().__init__(
|
super().__init__(
|
||||||
@@ -426,7 +427,7 @@ class KimiAudioForConditionalGeneration(
|
|||||||
DefaultModelLoader.Source(
|
DefaultModelLoader.Source(
|
||||||
model_or_path=vllm_config.model_config.model,
|
model_or_path=vllm_config.model_config.model,
|
||||||
subfolder="whisper-large-v3",
|
subfolder="whisper-large-v3",
|
||||||
revision=None,
|
revision=vllm_config.model_config.revision,
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ class KimiK25ProcessingInfo(BaseProcessingInfo):
|
|||||||
tokenizer = self.get_tokenizer()
|
tokenizer = self.get_tokenizer()
|
||||||
image_processor = cached_get_image_processor(
|
image_processor = cached_get_image_processor(
|
||||||
self.ctx.model_config.model,
|
self.ctx.model_config.model,
|
||||||
|
revision=self.ctx.model_config.revision,
|
||||||
trust_remote_code=self.ctx.model_config.trust_remote_code,
|
trust_remote_code=self.ctx.model_config.trust_remote_code,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1064,6 +1064,7 @@ class _ModelRegistry:
|
|||||||
module,
|
module,
|
||||||
model_config.model,
|
model_config.model,
|
||||||
revision=model_config.revision,
|
revision=model_config.revision,
|
||||||
|
code_revision=model_config.code_revision,
|
||||||
trust_remote_code=model_config.trust_remote_code,
|
trust_remote_code=model_config.trust_remote_code,
|
||||||
warn_on_fail=False,
|
warn_on_fail=False,
|
||||||
)
|
)
|
||||||
@@ -1077,6 +1078,7 @@ class _ModelRegistry:
|
|||||||
module,
|
module,
|
||||||
model_config.model,
|
model_config.model,
|
||||||
revision=model_config.revision,
|
revision=model_config.revision,
|
||||||
|
code_revision=model_config.code_revision,
|
||||||
trust_remote_code=model_config.trust_remote_code,
|
trust_remote_code=model_config.trust_remote_code,
|
||||||
warn_on_fail=True,
|
warn_on_fail=True,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ class BgeM3EmbeddingModel(RobertaEmbeddingModel):
|
|||||||
self.secondary_weights = [
|
self.secondary_weights = [
|
||||||
DefaultModelLoader.Source(
|
DefaultModelLoader.Source(
|
||||||
model_or_path=vllm_config.model_config.model,
|
model_or_path=vllm_config.model_config.model,
|
||||||
revision=None,
|
revision=vllm_config.model_config.revision,
|
||||||
prefix=prefix,
|
prefix=prefix,
|
||||||
allow_patterns_overrides=[filename],
|
allow_patterns_overrides=[filename],
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user