mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
fix(utils): avoid mutable fallback in dimension guard
Signed-off-by: Hasnaat Hussain <hasnaat.hussain.2@gmail.com>
This commit is contained in:
parent
17cdd165cb
commit
ec0fdf35dd
1 changed files with 1 additions and 2 deletions
|
|
@ -3764,13 +3764,12 @@ def get_optional_params_embeddings(
|
||||||
if "extra_body" in final_params and len(final_params["extra_body"]) == 0:
|
if "extra_body" in final_params and len(final_params["extra_body"]) == 0:
|
||||||
final_params.pop("extra_body", None)
|
final_params.pop("extra_body", None)
|
||||||
|
|
||||||
# High-performance check optimized to avoid allocations in hot paths
|
|
||||||
if (
|
if (
|
||||||
(litellm.drop_params is True or drop_params is True)
|
(litellm.drop_params is True or drop_params is True)
|
||||||
and (custom_llm_provider == "azure" or custom_llm_provider in litellm.openai_compatible_providers)
|
and (custom_llm_provider == "azure" or custom_llm_provider in litellm.openai_compatible_providers)
|
||||||
and model is not None
|
and model is not None
|
||||||
and "text-embedding-3" not in model
|
and "text-embedding-3" not in model
|
||||||
and "dimensions" not in (allowed_openai_params or [])
|
and "dimensions" not in (allowed_openai_params or ())
|
||||||
):
|
):
|
||||||
final_params.pop("dimensions", None)
|
final_params.pop("dimensions", None)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue