mirror of https://github.com/hwchase17/langchain
Handle length safe embedding only if needed (#3723)
Re: https://github.com/hwchase17/langchain/issues/3722
Copy pasting context from the issue:
1bf1c37c0c/langchain/embeddings/openai.py (L210-L211)
Means that the length safe embedding method is "always" used, initial
implementation https://github.com/hwchase17/langchain/pull/991 has the
`embedding_ctx_length` set to -1 (meaning you had to opt-in for the
length safe method), https://github.com/hwchase17/langchain/pull/2330
changed that to max length of OpenAI embeddings v2, meaning the length
safe method is used at all times.
How about changing that if branch to use length safe method only when
needed, meaning when the text is longer than the max context length?
pull/3765/head^2
parent
40f6e60e68
commit
37ed6f2177
Loading…
Reference in New Issue