Skip to content
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

支持embeddings使用类似openai api的server #3892

Closed
wants to merge 1 commit into from

Conversation

sydnash
Copy link

@sydnash sydnash commented Apr 26, 2024

目前只有embedding模型为text-embedding-ada-002的时候才会使用OpenAIEmbeddings

现在通过增加EMBEDDING_MODEL_USE_OPENAI和EMBEDDING_MODEL_OPENAI配置,可以使任意模型都可以通过OpenAIEmbeddings来调用自定义的类openai api的server来实现embedding。

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 26, 2024
@sydnash sydnash force-pushed the master branch 2 times, most recently from 6e8b750 to 4bf683a Compare April 28, 2024 03:07
@Shame-fight
Copy link

请问如何将本地embedding模型封装成openai api格式,以便其他机器上的langchain chatchat调用。老哥有没有推荐的方法或代码库

@zfishbone01
Copy link

速度真快,刚好需要用到,赞

@zfishbone01
Copy link

请问如果我用fastchat启动bge-large-zh作embedding的话,可以用这个api的访问方式吗?langchain本地启动了一个bge-large-zh用来做tokenizer会影响embedding的效果吗?我实际测试langcain的embedding跟fastchat出来的embedding数值不一样

@liunux4odoo
Copy link
Collaborator

0.3.x 版本里使用 LocalAIEmbeddings 访问本地部署的模型,请确认这个实现是否重复了?

@sydnash
Copy link
Author

sydnash commented Jun 17, 2024

embedding

只要是兼容openai的embedding api就可以的。 tokenizer和embedding是两步,应该没有影响。

@sydnash
Copy link
Author

sydnash commented Jun 17, 2024

0.3.x 版本里使用 LocalAIEmbeddings 访问本地部署的模型,请确认这个实现是否重复了?

看了下LocalAiEmbeddings也是使用openai client访问openai api兼容服务,应该是一样的功能。
这个可以在0.2.x里面也支持吗?

何将本地embedding模型封装成openai api格式,以便其他机器上的langchain chatchat调用。老哥有没有推荐的

vllm里面有opneai 兼容api封装的例子。

@glide-the
Copy link
Collaborator

你好,在2.0的贡献我们没有计划维护,目前主分支已经是3.0的代码,感谢你对本贡献,期待你的下次参与

3.0使用了第三方平台加载本地模型,对于本地模型的支持,请参考readme

@glide-the glide-the closed this Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants