Spaces:
Paused
Paused
Download prefetch.py from Chadbehaviour/sloptotal: direct link, hf CLI and curl.
- Browser
- Download file 1.28 kB
-
https://huggingface.co/spaces/Chadbehaviour/sloptotal/resolve/main/prefetch.py
- Command line
-
hf download hf://spaces/Chadbehaviour/sloptotal/prefetch.py
-
curl -L -o prefetch.py https://huggingface.co/spaces/Chadbehaviour/sloptotal/resolve/main/prefetch.py
1.28 kB
| """Haalt tijdens het bouwen alle SlopTotal-modellen op, zodat de Space niet bij elke start 9 GB hoeft te downloaden. | |
| Gebruik: python prefetch.py (downloadt alles) | |
| python prefetch.py --check (controleert alleen of alle modellen bestaan) | |
| """ | |
| import sys | |
| from huggingface_hub import HfApi, snapshot_download | |
| MODELS = [ | |
| "hyunseoki/ReMoDetect-deberta", | |
| "SuperAnnotate/ai-detector-low-fpr", | |
| "desklib/ai-text-detector-v1.01", | |
| "Hello-SimpleAI/chatgpt-detector-roberta", | |
| "Oxidane/tmr-ai-text-detector", | |
| "fakespot-ai/roberta-base-ai-text-detection-v1", | |
| "roberta-base-openai-detector", | |
| "MayZhou/e5-small-lora-ai-generated-detector", | |
| "ShantanuT01/BERT-tiny-RAID", | |
| "FacebookAI/roberta-large", | |
| "gpt2-medium", | |
| "distilgpt2", | |
| ] | |
| # alleen de PyTorch/safetensors-bestanden, geen dubbele formaten | |
| IGNORE = ["*.onnx", "*.msgpack", "*.h5", "*.ot", "*.tflite", "onnx/*", "flax_model*", "tf_model*", "rust_model*", "*.gguf"] | |
| if __name__ == "__main__": | |
| check = "--check" in sys.argv | |
| api = HfApi() | |
| for m in MODELS: | |
| if check: | |
| info = api.model_info(m) | |
| print("ok", m, info.id) | |
| else: | |
| print("ophalen", m, flush=True) | |
| snapshot_download(m, ignore_patterns=IGNORE) | |