Skip to content

Fix: handle deprecated 'embedding' kwarg with warning#2334

Open
lxcxjxhx wants to merge 3 commits into
abetlen:mainfrom
lxcxjxhx:fix/issue-2210-embedding-kwarg
Open

Fix: handle deprecated 'embedding' kwarg with warning#2334
lxcxjxhx wants to merge 3 commits into
abetlen:mainfrom
lxcxjxhx:fix/issue-2210-embedding-kwarg

Conversation

@lxcxjxhx

@lxcxjxhx lxcxjxhx commented Jul 9, 2026

Copy link
Copy Markdown

Fixes #2210

Problem

When users create a model with \Llama(embedding=True), the \embedding\ parameter is silently discarded by **kwargs, causing a \RuntimeError\ when calling \embed()\ method later.

Solution

  • Renamed the parameter from \embedding\ to \embeddings\ (plural form) to match \self.context_params.embeddings\
  • Added backward compatibility: if users still use the old \embedding\ parameter, a \DeprecationWarning\ is issued and the value is automatically assigned to \embeddings\

Testing

Verified that:

  1. \Llama(embeddings=True)\ works correctly
  2. \Llama(embedding=True)\ still works but shows a deprecation warning
  3. The \embed()\ method can be called successfully in both cases

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

Successfully merging this pull request may close these issues.

Llama() silently accepts and discards embedding kwarg; .embed() then raises confusingly

1 participant