Skip to content
Discussion options

You must be logged in to vote

Good question. I think the most elegant solution to this is to register a forward_hook from PyTorch on top of your model, which lets you get the embeddings prior to the model head. I think this is the best solution since one usually does not want to modify the model output for these cases.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@nilskre
Comment options

@rusty1s
Comment options

@nilskre
Comment options

@rusty1s
Comment options

Answer selected by nilskre
@nilskre
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants