RAG相关知识

简而言之就是外挂了一个数据库,然后在里面检索相关信息。最大的优势是无需再通过训练就能掌握相关领域的知识

配置相关环境

conda create -n llamaindex python=3.10
conda activate llamaindex
conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.7 -c pytorch -c nvidia
pip install einops
pip install  protobuf
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.

安装Llamaindex激活运行

安装好相关的包,使用开源词向量模型然后运行
llamaindex+Internlm2 RAG实践_pythonllamaindex+Internlm2 RAG实践_词向量_02
可以看到无法回答问题

LlamaIndex RAG

微调后运行
llamaindex+Internlm2 RAG实践_词向量_03