File size: 1,275 Bytes
b84ffa9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""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)