mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-29 08:27:43 +00:00
fix bug for embedding caused by PR 1188 (#1194)
This commit is contained in:
@@ -481,9 +481,12 @@ class APIBackend(ABC):
|
||||
or "\\'messages\\' must contain the word \\'json\\' in some form" in e.message
|
||||
):
|
||||
kwargs["add_json_in_prompt"] = True
|
||||
too_long_error_message = "maximum context length" in e.message or "input must have less than" in e.message # type: ignore[attr-defined]
|
||||
|
||||
if hasattr(e, "message") and embedding and too_long_error_message:
|
||||
too_long_error_message = hasattr(e, "message") and (
|
||||
"maximum context length" in e.message or "input must have less than" in e.message
|
||||
)
|
||||
|
||||
if embedding and too_long_error_message:
|
||||
if not embedding_truncated:
|
||||
# Handle embedding text too long error - truncate once and retry
|
||||
model_name = LLM_SETTINGS.embedding_model
|
||||
|
||||
Reference in New Issue
Block a user