Skip to content

enable auto cache clearing on dlabscratch #2

Open
@Saibo-creator

Description

@Saibo-creator

To avoid each user to redownload the model weights everytime, which wastes time and also storage, Julian has made this library:

from dlab_utils.paths import model_path, available_models
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained(model_path("meta-llama/Meta-Llama-3-8B-Instruct"))
tokenizer = AutoTokenizer.from_pretrained(model_path("meta-llama/Meta-Llama-3-8B-Instruct"))

print(available_models())

This is really good and simple. Would be even better with autodownloading
What I can do in addition when I get sudo is to periodically delete cache directory so that people need to go for this if they don't want to redownload everytime (edited)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions