Spaces:
Running
Running
github-actions[bot]
Deploy from GitHub 1af737237f5d10dfa9cf12849d98f47c3b30ce37 (filtered: code + Dockerfile + README + NOTICES only)
a2f55b2 Download scripts/download_weights.py from Veridicate/scanner: direct link, hf CLI and curl.
- Browser
- Download file 671 Bytes
-
https://huggingface.co/spaces/Veridicate/scanner/resolve/main/scripts/download_weights.py
- Command line
-
hf download hf://spaces/Veridicate/scanner/scripts/download_weights.py
-
curl -L -o download_weights.py https://huggingface.co/spaces/Veridicate/scanner/resolve/main/scripts/download_weights.py
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() | |