modal-labs / modal-examples

Examples of programs built using Modal
https://modal.com/docs
MIT License
682 stars 155 forks source link

we should pin model revisions on Hugging Face #615

Open charlesfrye opened 6 months ago

charlesfrye commented 6 months ago

models can still be yanked, but this should reduce the variability

Here's an example, which uses tgi:

def download_model():
    subprocess.run(
        [
            "text-generation-server",
            "download-weights",
            MODEL_ID,
            "--revision",
            REVISION,
        ],
        env={
            **os.environ,
            "HUGGING_FACE_HUB_TOKEN": os.environ["HF_TOKEN"],
        },
        check=True,
    )
charlesfrye commented 6 months ago

and once we've got more examples that do this, it should go in the PR template