phbst / tinyRAG

RAG兴趣小组,全手写的一个RAG应用。Langchain的大部分库会很方便,但是你不一定理解其中原理,所以代码尽可能展现基本算法,主打理解RAG的原理
91 stars 3 forks source link

component.embedding中的bug #1

Open HaoyangLee-airplus opened 2 months ago

HaoyangLee-airplus commented 2 months ago

你好!在component.embedding中第27-30行的函数compare中:

def compare(self, text1: str, temxt2: str):
    embed1=self.embedding.embed_query(text1) 
    embed2=self.embedding.embed_query(text2)
    return np.dot(embed1, embed2) / (np.linalg.norm(embed1) * np.linalg.norm(embed2))

第三个形参名称有误(temxt2 -> text2) 非常感谢同学的用心分享,我正在这个基础上进行学习,受益颇多😄

phbst commented 2 months ago

已经修改好了,谢谢你的建议和支持