LLM之RAG实战(四十四)| rag-chatbot:支持Huggingface和Ollama任意模型的多PDF本地RAG方案

特点:

  • 支持本地运行和Kaggle (new)运行
  • 支持Huggingface 和Ollama 的任意模型
  • Process multiple PDF inputs.
  • Chat with multiples languages (Coming soon).
  • Simple UI with Gradio.

一、安装使用

1.1 Kaggle(推荐)

Step1:把https://github.com/datvodinh/rag-chatbot/blob/main/notebooks/kaggle.ipynb脚本导入到Kaggle。

Step2:把<YOUR_NGROK_TOKEN>替换为自己的token。

1.2 本地安装

a)克隆项目

复制代码
git clone https://github.com/datvodinh/rag-chatbot.gitcd rag-chatbot

b)安装

Docker方式

复制代码
docker compose up --build

脚本方式(Ollama, Ngrok, python package)

复制代码
source ./scripts/install_extra.sh

手动安装

Step1:Ollama
Step2:Ngrok

Step3:安装rag_chatbot包

复制代码
source ./scripts/install.sh

c)启动

复制代码
source ./scripts/run.sh

或者

复制代码
python -m rag_chatbot --host localhost

使用Ngrok

复制代码
source ./scripts/run.sh --ngrok

此时,会下载大模型

大模型的配置文件:https://github.com/datvodinh/rag-chatbot/blob/main/rag_chatbot/setting/setting.py

LLM默认是:llama3:8b-instruct-q8_0

Embedding模型默认是:BAAI/bge-large-en-v1.5

此时,登录http://0.0.0.0:7860即可访问:

参考文献:

1 https://github.com/datvodinh/rag-chatbot

相关推荐
千里码aicood3 分钟前
基于DCGAN的手写体文字生成系统设计与实现
人工智能
空奈qwq12 分钟前
ANN 全连接神经网络入门指南:从神经元到深度学习的第一步
人工智能·python·深度学习·神经网络·算法·机器学习
weixin_4462608515 分钟前
SeLATM:面向数据探索与资源效率的片段级智能体主题建模
人工智能
scaryFann18 分钟前
企业 AI 进入费控系统的权限与安全设计:从权限交集到端到端工作流
人工智能·安全
袁俪19 分钟前
检索增强生成
人工智能
LX5677723 分钟前
制造业学RAG,核心不是聊天是传承
人工智能
CAE虚拟与现实24 分钟前
PyTorch和scikit-learn的区别
人工智能·pytorch·scikit-learn
liaiyang66824 分钟前
我花了几天测了5个Transformer:异常层到底「异常」在哪?
人工智能
DM今天肝到几点?25 分钟前
AI 安全 · 前沿实验室OpenAI 取消 GPT-6.1 Astra 发布、再停前沿训练:Agent 逃出沙箱之后,责任该算谁的
人工智能·gpt·安全·ai安全
10年前端老司机28 分钟前
LangChain Agent 切面钩子实战:解耦业务,一键复用通用能力
人工智能·langchain·agent