File size: 795 Bytes
1022407
 
 
 
847dfdc
1022407
 
 
847dfdc
 
1022407
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""Cache pinned inference files in the Space image before serving requests."""
from huggingface_hub import snapshot_download

from runtime import MODELS
from critic import CRITIC_ID, CRITIC_REVISION


if __name__ == "__main__":
    checkpoints = {**MODELS, CRITIC_ID: dict(revision=CRITIC_REVISION)}
    for model_id, spec in checkpoints.items():
        snapshot_download(
            repo_id=model_id,
            revision=spec["revision"],
            allow_patterns=[
                "config.json", "generation_config.json", "model.safetensors",
                "tokenizer.json", "tokenizer_config.json", "tokenizer.model",
                "special_tokens_map.json", "added_tokens.json", "chat_template.jinja",
                "merges.txt", "vocab.json", "LICENSE",
            ],
        )