Code Monkey home page Code Monkey logo

rag_for_beginners's Introduction

rag_for_beginners

简化版

参考 rag_with_openai_embedding.py,只使用了OpenAI的embedding接口,没有调用向量模型,实现简单。
可以先跑通这个流程。

安装依赖

pip install transformers torch torchvision
pip install numpy chromadb tqdm openai

向量数据库

参考 149行 ChromaDB 这个类的实现。

向量模型调用

如果你当前环境联网,下载模型权重很慢,可以使用本地下载的方式; 将下面的大模型权重下载下来,解压缩,放在一个目录里,比如D:\AAA,然后对下面这个代码的地址修改为D:\AAA。

BGE_MODEL_PATH = "D:\\codes\\bge-large-zh"  #替换成你自己的实际地址

大模型权重下载地址

链接:https://pan.baidu.com/s/1XMVmn0C57D7A4mfOjQnl1g
提取码:34r8

rag_for_beginners's People

Contributors

xls1994 avatar

Stargazers

paulxu avatar  avatar  avatar  avatar star avatar yzmai avatar  avatar hehan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.