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

Embedding model to inference mode (llm 01L) #5

Open
patputnam-db opened this issue Nov 21, 2023 · 0 comments
Open

Embedding model to inference mode (llm 01L) #5

patputnam-db opened this issue Nov 21, 2023 · 0 comments

Comments

@patputnam-db
Copy link

The TransformerEncoder model in CMD 14 is instantiated in 'training' mode. As such, the dropout layers are not frozen during inference. As such, re-running the embedding model multiple times on the same input tensors results in different embeddings.

Fix: Add a model.eval() call after the model is instantiated (cmd 14, line 11).

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

1 participant