scanner / scripts /download_weights.py
github-actions[bot]
Deploy from GitHub 1af737237f5d10dfa9cf12849d98f47c3b30ce37 (filtered: code + Dockerfile + README + NOTICES only)
a2f55b2
Raw History Blame Contribute Delete
671 Bytes
"""
Pre-download CLIP weights to the HuggingFace cache.
Run during Docker image build or first deploy so the first user-facing
request isn't blocked by a multi-hundred-MB download.
Usage
-----
python scripts/download_weights.py
"""
from __future__ import annotations
def main() -> None:
from transformers import CLIPModel, CLIPProcessor
from deepfake_scanner.config import settings
name = settings.clip_model_name
print(f"Downloading {name} (Apache-2.0 transformers, MIT-licensed weights)...")
CLIPProcessor.from_pretrained(name)
CLIPModel.from_pretrained(name)
print("Done. Weights cached.")
if __name__ == "__main__":
main()