Giter Site home page Giter Site logo

shibing624 / chatgpt-webui Goto Github PK

View Code? Open in Web Editor NEW
58.0 3.0 8.0 2.08 MB

ChatGPT WebUI using gradio. 给 LLM 对话和检索知识问答RAG提供一个简单好用的Web UI界面

License: Apache License 2.0

Python 51.44% Dockerfile 0.12% JavaScript 21.24% CSS 14.50% HTML 12.36% Shell 0.31% Batchfile 0.03%
chatgpt chatgpt-api chatpdf gpt4 gradio webui chatgpt-webui

chatgpt-webui's Introduction

🇨🇳中文 | 🌐English | 📖文档/Docs | 🤖模型/Models


ChatGPT WebUI: ChatGPT webui using gradio

License Apache 2.0 python_version GitHub issues Wechat Group

chatgpt-webui: ChatGPT webui using gradio. 为ChatGPT等多种LLM提供了一个轻快好用的Web图形界面

img

✨ Features

本项目基于 ChuanhuChatGPT 简化而来,主要改动如下:

  1. 简化了WebUI页面,只保留核心的ChatGPT对话(LLM)、文档检索对话(RAG)功能,去除了midjourney等功能
  2. 重构了代码逻辑和结构,规范python语法,轻量化项目依赖库
  3. 保留本地大语言模型对话,方便扩展本地模型
  4. 支持nginx反向代理,静态文件使用相对路径,方便部署
  5. 提升RAG检索准确率
    • 引入jieba分词的rank_BM25,提升对query关键词的字面匹配,使用字面相似度+sentence embedding向量相似度加权获取corpus候选集
    • RAG底模优化,使用基于RAG微调的模型
    • Chinese chunk切分优化
  6. 优化了在线搜索功能,支持DuckDuckGo、Google、Bing、Serper等搜索引擎,提升搜索准确率

支持模型

使用技巧

💪 强力功能

  • GPT4 API:基于代理配置GPT4 API,支持多用户对话;
  • 本地部署LLM:一键部署,获取属于你自己的大语言模型。

🤖 System Prompt

  • 通过 System Prompt 设定前提条件,可以很有效地进行角色扮演;
  • 川虎Chat 预设了Prompt模板,点击加载Prompt模板,先选择 Prompt 模板集合,然后在下方选择想要的 Prompt。

💬 基础对话

  • 如果回答不满意,可以使用 重新生成 按钮再试一次,或者直接 删除这轮对话;
  • 输入框支持换行,按 Shift + Enter即可;
  • 在输入框按 方向键,可以在发送记录中快速切换;
  • 每次新建一个对话太麻烦,试试 单论对话 功能;
  • 回答气泡旁边的小按钮,不仅能 一键复制,还能 查看Markdown原文
  • 指定回答语言,让 ChatGPT 固定以某种语言回答。

📜 对话历史

  • 对话历史记录会被自动保存,不用担心问完之后找不到了;
  • 多用户历史记录隔离,除了你都看不到;
  • 重命名历史记录,方便日后查找;
  • New! 魔法般自动命名历史记录,让 LLM 理解对话内容,帮你自动为历史记录命名!
  • New! 搜索历史记录,支持正则表达式!

🖼️ 小而美的体验

  • 自研 Small-and-Beautiful 主题,带给你小而美的体验;
  • 自动亮暗色切换,给你从早到晚的舒适体验;
  • 完美渲染 LaTeX / 表格 / 代码块,支持代码高亮;
  • New! 非线性动画、毛玻璃效果,精致得不像 Gradio!
  • New! 适配 Windows / macOS / Linux / iOS / Android,从图标到全面屏适配,给你最合适的体验!
  • New! 支持以 PWA应用程序 安装,体验更加原生!

👨‍💻 极客功能

  • 大量 LLM 参数可调;
  • 支持更换 api-host;
  • 支持自定义代理;
  • 支持多 api-key 负载均衡。

⚒️ 部署相关

  • 部署到服务器:在 config.json 中设置 "server_name": "0.0.0.0", "server_port": <你的端口号>,
  • 获取公共链接:在 config.json 中设置 "share": true,。注意程序必须在运行,才能通过公共链接访问。
  • 在Hugging Face上使用:建议在右上角 复制Space 再使用,这样App反应可能会快一点。

快速上手

在终端执行以下命令:

git clone https://github.com/shibing624/chatgpt-webui.git
cd chatgpt-webui
pip install -r requirements.txt

然后,在项目文件夹中复制一份 config_example.json,并将其重命名为 config.json,在其中填入 API-Key 等设置。

python main.py

一个浏览器窗口将会自动打开,可以与ChatGPT或其他模型进行对话。

疑难杂症解决

在遇到各种问题查阅相关信息前,您可以先尝试 手动拉取本项目的最新更改1更新依赖库2,然后重试。步骤为:

  1. 点击网页上的 Download ZIP 按钮,下载最新代码并解压覆盖,或
    git pull https://github.com/shibing624/chatgpt-webui.git main -f
  2. 尝试再次安装依赖(可能本项目引入了新的依赖)
    pip install -r requirements.txt
    

很多时候,这样就可以解决问题。

如果问题仍然存在,请查阅该页面:常见问题

该页面列出了几乎所有您可能遇到的各种问题,包括如何配置代理,以及遇到问题后您该采取的措施,请务必认真阅读

Contact

  • Issue(建议) :GitHub issues
  • 邮件我:xuming: [email protected]
  • 微信我: 加我微信号:xuming624, 备注:姓名-公司名-NLP 进NLP交流群(加我拉你进群)。

chatgpt-webui's People

Contributors

peilongchencc avatar shibing624 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.