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

小白请教本地部署的glm4如何封装Embedding #151

Open
Ch1r3 opened this issue Dec 3, 2024 · 1 comment
Open

小白请教本地部署的glm4如何封装Embedding #151

Ch1r3 opened this issue Dec 3, 2024 · 1 comment

Comments

@Ch1r3
Copy link

Ch1r3 commented Dec 3, 2024

hello,我跟着教程通过调用智谱api的方法已经实现了RAG,但是最近在学习本地部署glm4。我跟着另一个教程(self-llm)完成了fastapi的部署,想请教一下,该如何在本教程的Embedding封装脚本中修改实现呢?是直接将原来的api接口改成本地部署的fastapi连接,还是要重新在langchain中重写Embedding方法?因为智谱的embedding-3模型是ZhipuAI()的一个固有方法,联网调用api是可以直接用的,但本地部署不通过zhipuai包的话,在哪里选择嵌入模型呢。这一段是教程中的code,求问整个脚本应如何修改。

    from zhipuai import ZhipuAI
    values["client"] = ZhipuAI()
    return values

我在self-llm也提出了issue,作者让我来这边参考,感谢 :)

@lta155
Copy link
Contributor

lta155 commented Jan 13, 2025

你好,对于你部署的glm4模型属于llm,它的作用是根据召回的文档回答问题;而你要封装的Embedding模型的作用是将知识库中的文档转换为向量(一行多维的向量)。glm4并不能把文档向量化,如果你想要本地部署Embedding模型的话可以看这部分内容中使用开源向量模型的部分。
如果有其他问题or建议欢迎沟通交流:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants