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 add projection #53

Open
threestone965 opened this issue Sep 10, 2024 · 1 comment
Open

how to add projection #53

threestone965 opened this issue Sep 10, 2024 · 1 comment

Comments

@threestone965
Copy link

How to add a projection module to an existing model? The hidden_state of this model is too large.
i added projection=128 in the train_embonly.sh, but the result files don't not contain the projection weights.

@Muennighoff
Copy link
Collaborator

The projection layer is created here

self.projection = torch.nn.Linear(
and should be created when you pass the projection kwarg

It should get saved when the model is saved i.e. here

trainer.save_model()
but if not you can e.g. add something like torch.save(model.projection, "projection.pt") right there below to save it - Let me know how it goes!

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