Giter Site home page Giter Site logo

chatbot's Introduction

聊天机器人

本项目是一个基于Gradio和Langchain开发的聊天机器人,支持以下四类大模型的调用:

  • OpenAI:gpt-3.5-turbo, gpt-3.5-turbo-16k-0613, gpt-3.5-turbo-0613, gpt-4, gpt-4-32k
  • 智谱:chatglm_pro, chatglm_std, chatglm_lite, glm-3-turbo, glm-4v, glm-4
  • 文心:ERNIE-Bot, ERNIE-Bot-4, ERNIE-Bot-turbo
  • 讯飞:Spark-1.5, Spark-2.0

在实际部署的时候需要生成一个.env文件,用于配置各类模型的相应参数,如果只是本地练习,可以在代码run_gradio.py中直接配置。

本项目的启动流程如下所示:

1、python环境配置:

pip install -r requirements.txt

2、project目录下创建一个名为.env的文件,配置调用每类模型需要的参数,格式如下:

ZHIPUAI_API_KEY=""
OPENAI_API_KEY=""
wenxin_api_key=""
wenxin_secret_key=""
spark_api_key=""
spark_appid=""
spark_api_secret=""

3、运行run_gradio.py

python run_gradio.py

4、打开 http://localhost:7860 即可看到聊天机器人界面(如果部署在服务器上,就把localhost换成相应IP):

image-20240417094802714

chatbot's People

Contributors

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