-
Notifications
You must be signed in to change notification settings - Fork 16.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
community: make LocalAIEmbeddings comaptible with openai>1.0 #17154
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
langchain_community/embeddings/localai.py:1:1: I001 Import block is un-sorted or un-formatted |
these changes work great for me using localai embeddings with news openai - thanks! submitted a pr to your fork for the lint errors |
hope we can merge as soon as possible. I have encountered the same problem. |
I moved this to #18799 and got it to pass the CI tests |
Fix lint error
@eahova I have merge your pr for lint fixing. |
This PR helps a lot! Plz review asap @baskaryan @eyurtsev @hwchase17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we make this compatible with both openai v0 and v1, the way langchain_community.embedding.OpenAIEmbeddings is? or if that's too hard we should at least add an explicit version check of the openai sdk and raise an informative error if it's less than 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
surely it has been done.
retry_if_exception_type(openai.Timeout) | ||
| retry_if_exception_type(openai.APIError) | ||
| retry_if_exception_type(openai.APIConnectionError) | ||
| retry_if_exception_type(openai.RateLimitError) | ||
| retry_if_exception_type(openai.InternalServerError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think this is v0 compatible
embed_with_retry( | ||
self, | ||
input=[text], | ||
**self._invocation_params, | ||
) | ||
.data[0] | ||
.embedding | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think this is v0 compatible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same below
Hey @baskaryan @liunux4odoo any updates here? Anything you need help with? I'm interested in getting this released asap |
I would like to close this PR because latest langchain-openai works well with locally served embeddings by xinference. |
I run the
bge-large
embedding model by xinference locally, but the latestLocalAIEmbeddings can only work with
openai<1.0, not comaptible with the latest
openai`.I upgrade the
LocalAIEmbeddings
referencing toChatOpenAI
to make it working withopenai>1.0
.