etched-ai / open-oasis

Inference script for Oasis 500M
MIT License
1.53k stars 128 forks source link

Suggestion: This script to download and symlink the model files #34

Open wrzwicky opened 2 weeks ago

wrzwicky commented 2 weeks ago

I made a little utility to download and symlink the two model files so that generate.py just works with no arguments. The function hf_hub_download() used here is equivalent to huggingface-cli download in your instructions.

Verified on Windows, but should work on every platform.

import os
from huggingface_hub import hf_hub_download

oasis_st = hf_hub_download(repo_id="Etched/oasis-500m", filename="oasis500m.safetensors")
print(oasis_st)
os.symlink(oasis_st, "oasis500m.safetensors")

vit_st = hf_hub_download(repo_id="Etched/oasis-500m", filename="vit-l-20.safetensors")
print(vit_st)
os.symlink(vit_st, "vit-l-20.safetensors")