Reuse cached CLIP weights during GPU benchmark
CI / test (push) Successful in 12s

This commit is contained in:
2026-10-01 23:12:38 +08:00
parent 42e931f193
commit 521dfb3d57
+3 -1
View File
@@ -75,7 +75,9 @@ class CLIPFrozenBackbone(FrozenBackbone):
from transformers import AutoTokenizer, CLIPModel
except ImportError as error:
raise RuntimeError("Install the 'hf' extra to use the CLIP backbone.") from error
self.model = CLIPModel.from_pretrained(model_name)
# Keep training and the post-training benchmark on the same cached artifact.
# Otherwise Hugging Face may fetch both the legacy .bin and safetensors weights.
self.model = CLIPModel.from_pretrained(model_name, use_safetensors=False)
self.tokenizer = AutoTokenizer.from_pretrained(model_name)
self.model.requires_grad_(False).eval()
self.vision_dim = self.model.config.vision_config.hidden_size