Commit 738b029d authored by ACzhangchao's avatar ACzhangchao
Browse files

Update README

parent 16b2fe7b
...@@ -8,23 +8,45 @@ https://www.modelscope.cn/models/JiuTian-AI/JIUTIAN-139MoE-chat/file/view/master ...@@ -8,23 +8,45 @@ https://www.modelscope.cn/models/JiuTian-AI/JIUTIAN-139MoE-chat/file/view/master
JIUTIAN-139MoE是一个拥有130亿参数的大型语言模型,使用解码器型的MoE架构,包含一对大专家和六个小专家。模型支持在不同GPU和NPU集群上训练,并能无损切换。在FFN层采用MoE设计,有特殊的激活和路由机制。 JIUTIAN-139MoE是一个拥有130亿参数的大型语言模型,使用解码器型的MoE架构,包含一对大专家和六个小专家。模型支持在不同GPU和NPU集群上训练,并能无损切换。在FFN层采用MoE设计,有特殊的激活和路由机制。
![jiutian.png](https://developer.hpccube.com/codes/modelzoo/jiutian-139moe-chat/-/raw/main/jiutian.png?inline=false) ![](D:\相关图片\jiutian.png)
## 算法原理 ## 算法原理
JIUTIAN-139MoE利用Mixture-of-Experts (MoE) 架构,通过不同规模的专家网络处理不同的数据特征,并通过门控机制智能地分配任务给最合适的专家,从而提高模型处理复杂问题的能力。 JIUTIAN-139MoE利用Mixture-of-Experts (MoE) 架构,通过不同规模的专家网络处理不同的数据特征,并通过门控机制智能地分配任务给最合适的专家,从而提高模型处理复杂问题的能力。
![](D:\相关图片\MoE.png)
## 环境配置 ## 环境配置
### Docker ### Docker(方法一)
拉取镜像,启动并进入容器 拉取镜像,启动并进入容器
``` ```
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.1.0-ubuntu20.04-dtk24.04.1-py3.10 docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.1.0-ubuntu20.04-dtk24.04.1-py3.10
docker run -it --shm-size 80g --network=host --name=jiutian --privileged --device /dev/m--device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v /opt/hyhal/:/opt/hyhal/:ro image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.1.0-ubuntu20.04-dtk24.04.1-py3.10 /bin/bash # <Image ID>用上面拉取docker镜像的ID替换
# <Host Path>主机端路径
# <Container Path>容器映射路径
docker run -it --shm-size 80g --network=host --name=jiutian --privileged --device /dev/m--device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v /opt/hyhal/:/opt/hyhal/:ro -v <Host Path>:<Container Path> <Image ID> /bin/bash
``` ```
### Dockerfile(方法二)
```
# <Host Path>主机端路径
# <Container Path>容器映射路径
docker build -t jiutian:latest .
docker run -it --shm-size 80g --network=host --name=jiutian --privileged --device /dev/m--device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v /opt/hyhal/:/opt/hyhal/:ro -v <Host Path>:<Container Path> <Image ID> /bin/bash
```
### Anaconda(方法三)
```
conda create -n jiutian python=3.10
```
## 模型下载
``` ```
#克隆项目 #克隆项目
git clone http://developer.hpccube.com/codes/modelzoo/jiutian-139moe-chat.git git clone http://developer.hpccube.com/codes/modelzoo/jiutian-139moe-chat.git
...@@ -37,7 +59,11 @@ cd jiutian-139moe-chat ...@@ -37,7 +59,11 @@ cd jiutian-139moe-chat
### 模型推理 ## 训练
## 推理
``` ```
python inference.py python inference.py
...@@ -57,7 +83,7 @@ python app.py ...@@ -57,7 +83,7 @@ python app.py
curl -X POST "http://localhost:8000/predict/" -H "Content-Type: application/json" -d '{"text": "Please introduce the Great Wall."}' curl -X POST "http://localhost:8000/predict/" -H "Content-Type: application/json" -d '{"text": "Please introduce the Great Wall."}'
``` ```
成功调用会在终端生成内容: ## result
``` ```
{"response":"Human:\nPlease introduce the Great Wall.\n\nAssistant:\n The Great Wall of China is a series of fortifications built along the northern borders of China to protect against invasions and raids from various nomadic groups. It is one of the most famous landmarks in China and is also one of the largest construction projects in human history.\n\nThe Great Wall stretches"} {"response":"Human:\nPlease introduce the Great Wall.\n\nAssistant:\n The Great Wall of China is a series of fortifications built along the northern borders of China to protect against invasions and raids from various nomadic groups. It is one of the most famous landmarks in China and is also one of the largest construction projects in human history.\n\nThe Great Wall stretches"}
......
icon.png

53.8 KB

Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment