【作业】使用中文数据微调code-llama,并测试效果 #36

Open
opened 2024-11-03 22:06:16 +08:00 by 12688178917cs · 0 comments

中文数据微调code-llama并接入fastgpt

训练模型

模型训练后,打包tar
image

Xinferece部署微调模型

通过autodl安装Xinferece,登录autodl实例后,打开终端

wget下载模型并解tar包

安装xinference
pip install "xinference[all]"

启动xinference
xinference-local --host 0.0.0.0 --port 9997

本机配置隧道,目的是从本机访问Xinference
ssh -CNgv -L 9997:127.0.0.1:9997 root@connect.yza1.seetacloud.com -p 25266

打开Xinference UI
http://127.0.0.1:9997/

找到code-llama-instruce
image

code-llama-instruct配置并启动
image

FASTGPT部署

租用腾讯云服务器,选择Ubuntu镜像、磁盘30G即可、配置登录密码,其余默认即可
登录云服务器

切换root,避免一些权限问题
sudo su

创建并进入个人目录
mkdir -p /yjl1/fastgpt && cd /yjl/fastgpt

创建文件docker-compose.yml
创建配置文件config.json

更新apt,安装docker-compose

启动容器服务,包括fastgpt、oneapi等
docker-compose up -d

查看服务启动状态
docker-compose ps
image

由于云服务器默认不开放以上端口,需要配置安全组策略才可以在本机访问
在安全组规则中,直接配置,所有协议端口,本机ip可访问
image

通过 {服务器公网ip}:3001,打开oneapi页面
默认账号密码为 root/123456,登录后修改密码

点击渠道->添加新的渠道
image

配置安全组
需要允许服务器访问自己的9997端口,配置如下
image

在云服务器上建立隧道,目的是将请求转到autodl上的Xinference
ssh -CNgv -L 9997:127.0.0.1:9997 root@connect.yza1.seetacloud.com -p 25266

通过 {服务器公网ip}:3000,打开fastgpt页面,root/1234

新建简易机器人 code-llama-instruct

AI配置,模型选择code-llama-instruct
image

输入对话,其中Input是中文,得到结果
image

### 中文数据微调code-llama并接入fastgpt #### 训练模型 模型训练后,打包tar <img width="416" alt="image" src="/attachments/214a143d-1259-4ed4-bfd7-adc06a187a36"> #### Xinferece部署微调模型 通过autodl安装Xinferece,登录autodl实例后,打开终端 wget下载模型并解tar包 安装xinference pip install "xinference[all]" 启动xinference xinference-local --host 0.0.0.0 --port 9997 本机配置隧道,目的是从本机访问Xinference ssh -CNgv -L 9997:127.0.0.1:9997 root@connect.yza1.seetacloud.com -p 25266 打开Xinference UI http://127.0.0.1:9997/ 找到code-llama-instruce <img width="415" alt="image" src="/attachments/e469d070-4665-4499-8aed-8da3800ec805"> code-llama-instruct配置并启动 <img width="416" alt="image" src="/attachments/45628ad6-0010-46c0-a5b2-08d2f650ec90"> #### FASTGPT部署 租用腾讯云服务器,选择Ubuntu镜像、磁盘30G即可、配置登录密码,其余默认即可 登录云服务器 切换root,避免一些权限问题 sudo su 创建并进入个人目录 mkdir -p /yjl1/fastgpt && cd /yjl/fastgpt 创建文件docker-compose.yml 创建配置文件config.json 更新apt,安装docker-compose 启动容器服务,包括fastgpt、oneapi等 docker-compose up -d 查看服务启动状态 docker-compose ps <img width="415" alt="image" src="/attachments/c45011b2-5741-4ff7-8e19-7c27b94ed61f"> 由于云服务器默认不开放以上端口,需要配置安全组策略才可以在本机访问 在安全组规则中,直接配置,所有协议端口,本机ip可访问 <img width="416" alt="image" src="/attachments/97e65505-2c10-4755-90a5-fa6033b0b8ac"> 通过 {服务器公网ip}:3001,打开oneapi页面 默认账号密码为 root/123456,登录后修改密码 点击渠道->添加新的渠道 <img width="415" alt="image" src="/attachments/8e74fe22-6bd6-45b1-9adb-b219da454cb1"> 配置安全组 需要允许服务器访问自己的9997端口,配置如下 <img width="416" alt="image" src="/attachments/89f7e1c2-c272-4cfd-bbcf-607a02b23ea9"> 在云服务器上建立隧道,目的是将请求转到autodl上的Xinference ssh -CNgv -L 9997:127.0.0.1:9997 root@connect.yza1.seetacloud.com -p 25266 通过 {服务器公网ip}:3000,打开fastgpt页面,root/1234 新建简易机器人 code-llama-instruct AI配置,模型选择code-llama-instruct <img width="209" alt="image" src="/attachments/abe950f3-e09d-4e09-aeb7-acf30b167ba1"> 输入对话,其中Input是中文,得到结果 <img width="415" alt="image" src="/attachments/badd8290-2af2-4d33-858a-25eaa598709c">
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: HswOAuth/llm_share#36
No description provided.