Skip to content

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

@patputnam-db

Description

@patputnam-db

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions