mirror of
https://github.com/hwchase17/langchain
synced 2024-10-29 17:07:25 +00:00
8a7c95e555
Description: The OpenAI "embeddings" API intermittently falls into a failure state where an embedding is returned as [ Nan ], rather than the expected 1536 floats. This patch checks for that state (specifically, for an embedding of length 1) and if it occurs, throws an ApiError, which will cause the chunk to be retried. Issue: I have been unable to find an official langchain issue for this problem, but it is discussed (by another user) at https://stackoverflow.com/questions/76469415/getting-embeddings-of-length-1-from-langchain-openaiembeddings Maintainer: @dev2049 Testing: Since this is an intermittent OpenAI issue, I have not provided a unit or integration test. The provided code has, though, been run successfully over several million tokens. --------- Co-authored-by: William Webber <william@williamwebber.com> Co-authored-by: Harrison Chase <hw.chase.17@gmail.com> |
||
---|---|---|
.. | ||
agents | ||
callbacks | ||
chains | ||
chat_models | ||
client | ||
docstore | ||
document_loaders | ||
embeddings | ||
evaluation | ||
experimental | ||
graphs | ||
indexes | ||
llms | ||
load | ||
memory | ||
output_parsers | ||
prompts | ||
retrievers | ||
schema | ||
tools | ||
utilities | ||
vectorstores | ||
__init__.py | ||
base_language.py | ||
cache.py | ||
docker-compose.yaml | ||
document_transformers.py | ||
env.py | ||
example_generator.py | ||
formatting.py | ||
input.py | ||
math_utils.py | ||
model_laboratory.py | ||
py.typed | ||
python.py | ||
requests.py | ||
serpapi.py | ||
server.py | ||
sql_database.py | ||
text_splitter.py | ||
utils.py |