llama3仿openai api的实验(AutoDL服务器) #161
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: HswOAuth/llm_course#161
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
本次实验是使用AutoDL平台服务器来实现llama3仿openai api的实验。AutoDL上租用一台gpu按量付费并不贵,在后面的llama factory也用的是这个。
本次课属于【大模型本地部署应用】,基于Chinese-LLaMA-Alpaca-3项目,介绍如何封装一个私有的兼容openai api的大模型接口,并使用ChatGPTNextWeb开源工具调用此接口。
租用服务器
首先点这里租用实例;
然后在这里按照要求选择你要用的gpu;
然后选择需要用的镜像创建即可;
创建完成后在相应实例选择开机就可以使用了。
实验环境搭建
首先下载实验需要用到的代码:
安装miniconda:
创建并启动虚拟环境
代码bug修复
在Chinese-LLaMA-Alpaca-3-3.0/scripts/oai_api_demo/openai_api_server.py文件中将generation_kwargs中的内容做如下修改:
加入上面的参数主要是为了兼容llama3特有的停止token,不然流式接口返回的内容会不断的自动重复,不停止。
安装依赖
首先备份原来存在的脚本
创建新的requirements.txt并写入新的依赖
然后安装以上依赖:
启动服务
查看模型所在位置
启动服务
测试效果
ChatGPTNextWeb下载
Windows下载ChatGPTNextWeb工具
设置接入刚刚部署的大模型
llama3仿openai api的实验to llama3仿openai api的实验(AutoDL服务器)