Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make download stats work #91

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

NielsRogge
Copy link

@NielsRogge NielsRogge commented Sep 20, 2024

Hi @mini-omni,

Thanks for this nice work! Niels here from HF.

I noticed you already use the 🤗 hub for loading the model, which is great!

This PR aims to improve the integration by:

  • adding from_pretrained and push_to_hub capabilities to the GPT model
  • making sure download numbers work for your model (similar to models in the Transformers library)

It leverages the PyTorchModelHubMixin class which allows to inherits these methods.

Usage is as follows:

from litgpt.model import GPT

# define model
model = GPT(...)

# equip with weights
model.load_state_dict(...)

# push to hub
model.push_to_hub("gpt-omni/mini-omni")

# reload
model = GPT.from_pretrained("gpt-omni/mini-omni")

This means people don't need to manually download a checkpoint first in their local environment, it just loads automatically from the hub.

Would you be interested in this integration?

Kind regards,

Niels

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant