Skip to content

基于开源模型部署自己的chatGpt2.0,完全可以离线使用

Notifications You must be signed in to change notification settings

jianwi/chatGpt2-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatGPT-2 Demo

基于 chatGpt-2实现与Ai对话功能。
在本地部署ChatGPT-2模型,并实现一个简单的对话客户端(基于flask)。

环境准备

确保您已安装以下依赖:

  • Python 3.6 或更高版本
  • pip

安装

  1. 克隆项目:
 git clone https://github.com/jianwi/chatGpt2-demo.git
  1. 安装所需依赖:
pip install -r requirements.txt

使用方法

  1. 运行Flask API:
python app.py

默认情况下,API将在http://127.0.0.1:5000/上运行。

在浏览器中打开http://127.0.0.1:5000/,您将看到一个简单的前端页面,可以输入问题并获取GPT-2生成的回复。

注意事项

  • 可以根据需要调整GPT-2模型的参数,以获得更高质量的生成结果。 比如增加max_length的值,可以输出更多字符。
  • 如果运行不起来,可能需要安装 PyTorch库:
pip install torch

演示

问题1

在html中显示hello world 问题2

调节max_length值,输出更多字符 问题3

About

基于开源模型部署自己的chatGpt2.0,完全可以离线使用

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published