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

how to save, Load and Finetune the model #29

Open
Lokeshwaran-M opened this issue Aug 25, 2023 · 1 comment
Open

how to save, Load and Finetune the model #29

Lokeshwaran-M opened this issue Aug 25, 2023 · 1 comment

Comments

@Lokeshwaran-M
Copy link

Lokeshwaran-M commented Aug 25, 2023

Model :

model = LanguageModel()

To Save

with open('model.pkl', 'wb') as f:
    pickle.dump(model, f)

To Load :

with open('model.pkl', 'rb') as f:
    model = pickle.load(f)
m = model.to(device)
@Lokeshwaran-M Lokeshwaran-M changed the title how to save and finetune the saved model like nano-gpt repo how to save, Load and Finetune the model Aug 27, 2023
@exponentialXP
Copy link

You can also use: torch.save() and torch.load() for the model and/or optimizer's state_dict()

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

No branches or pull requests

2 participants