Skip to content

Support finetuning from a pretrained model #1321

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

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

Conversation

vwxyzjn
Copy link

@vwxyzjn vwxyzjn commented Jun 20, 2025

Continuation of #1300. Cleaner implementation.

@vwxyzjn vwxyzjn requested review from tianyu-l, fegin and wwwjn as code owners June 20, 2025 19:31
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 20, 2025
@@ -70,6 +75,7 @@ def load_state_dict(self, state_dict: dict[str, Any]) -> None:
# we will need to reinitialize the cache_state_dict.
self.cache_state_dict = {
k: v for sd in map(get_model_state_dict, self.model) for k, v in sd.items()
if k not in excluded_parameters_for_model_only
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed here because I was getting RuntimeError: Missing key in checkpoint state_dict: model.freqs_cis. if I am trying to load a full checkpoint.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fegin can you take a look at this part?
I can verify that I couldn't load a seed checkpoint before this PR; with this PR I was able load the seed checkpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants