Skip to content

Quickstart prints transformers load warning: embeddings.position_ids UNEXPECTED #289

@colygon

Description

@colygon

Title: Quickstart prints noisy transformers load warning: embeddings.position_ids | UNEXPECTED when downloading sentence-transformers model

Summary

When running the Quickstart on a fresh environment, the console output includes a Transformers/Sentence-Transformers load report like:

Loading weights: 100%|██████| ...
BertModel LOAD REPORT from: sentence-transformers/all-MiniLM-L6-v2
Key | Status |
...
embeddings.position_ids | UNEXPECTED
Notes:
- UNEXPECTED :can be ignored when loading from different task/architecture; not ok if you expect identical arch.

This is confusing for first-time users because it looks like a broken install or model mismatch, but in practice the quickstart still works.

Why it happens

This appears to be upstream logging from transformers when Sentence-Transformers loads all-MiniLM-L6-v2 and encounters an extra/missing state key (often harmless, especially across minor model/architecture variations).

Impact

  • Increases time-to-first-success due to perceived error.
  • Adds noise in CLI output and docs screenshots.

Proposed fixes

Docs (quick win)

Add a note to Quickstart/Troubleshooting: this message is expected on first run and is safe to ignore.

Code (better DX)

Silence or reduce verbosity during embedding model download/load:

  • Set Transformers verbosity to error in Memori init / embeddings module:
    • from transformers.utils import logging as hf_logging; hf_logging.set_verbosity_error()
  • Optionally disable progress bars:
    • HF_HUB_DISABLE_PROGRESS_BARS=1
    • TRANSFORMERS_NO_ADVISORY_WARNINGS=1

Optional: pin/compat

If the warning is driven by a specific transformers/sentence-transformers combination, consider pinning compatible versions (or adding a constraint) to reduce surprises.

Workaround for users today

Before running quickstart:

export TRANSFORMERS_VERBOSITY=error
export HF_HUB_DISABLE_PROGRESS_BARS=1

(or set Transformers logging in Python).

Environment

Seen on macOS with a fresh venv running the Memori quickstart.

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