Commit 69faa814 authored by Rayyyyy's avatar Rayyyyy
Browse files

Add icon and SCNet

parent 648d9385
# deepseek-v2 # deepseek-v2
## 论文 ## 论文
[deepseek-v2](https://arxiv.org/abs/2405.04434) `DeepSeek-V2`
- https://arxiv.org/abs/2405.04434
## 模型结构 ## 模型结构
<div align=center> <div align=center>
...@@ -20,8 +21,6 @@ docker run -it -v /path/your_code_data/:/path/your_code_data/ -v /opt/hyhal/:/op ...@@ -20,8 +21,6 @@ docker run -it -v /path/your_code_data/:/path/your_code_data/ -v /opt/hyhal/:/op
cd /your_code_path/deepseek-v2_pytorch cd /your_code_path/deepseek-v2_pytorch
pip install -r requirements.txt pip install -r requirements.txt
pip install -U huggingface_hub hf_transfer
export HF_ENDPOINT=https://hf-mirror.com
``` ```
### Dockerfile(方法二) ### Dockerfile(方法二)
...@@ -32,8 +31,6 @@ docker run -it -v /path/your_code_data/:/path/your_code_data/ -v /opt/hyhal/:/op ...@@ -32,8 +31,6 @@ docker run -it -v /path/your_code_data/:/path/your_code_data/ -v /opt/hyhal/:/op
cd /your_code_path/deepseek-v2_pytorch cd /your_code_path/deepseek-v2_pytorch
pip install -r requirements.txt pip install -r requirements.txt
pip install -U huggingface_hub hf_transfer
export HF_ENDPOINT=https://hf-mirror.com
``` ```
### Anaconda(方法三) ### Anaconda(方法三)
...@@ -48,8 +45,6 @@ torch: 2.1.0 ...@@ -48,8 +45,6 @@ torch: 2.1.0
其它非深度学习库安装方式如下: 其它非深度学习库安装方式如下:
```bash ```bash
pip install -r requirements.txt pip install -r requirements.txt
pip install -U huggingface_hub hf_transfer
export HF_ENDPOINT=https://hf-mirror.com
``` ```
## 数据集 ## 数据集
...@@ -61,26 +56,26 @@ export HF_ENDPOINT=https://hf-mirror.com ...@@ -61,26 +56,26 @@ export HF_ENDPOINT=https://hf-mirror.com
## 推理 ## 推理
基于**Huggingface's Transformers**进行推理,根据本地模型地址设置`model_name_or_path`参数。 基于**Huggingface's Transformers**进行推理,根据本地模型地址设置`model_name_or_path`参数。
如未下载预训练模型,代码会根据选择自动进行下载,当前可用模型为:"deepseek-ai/DeepSeek-V2-Lite"、"deepseek-ai/DeepSeek-V2-Lite-Chat"。 如未下载预训练模型,请通过[#预训练权重](#预训练权重)进行下载。
当然,本项目支持代码自动进行下载,需按照下方命令进行HF相关库的安装,当前可用模型为:"deepseek-ai/DeepSeek-V2-Lite"、"deepseek-ai/DeepSeek-V2-Lite-Chat"。
### 文本扩写
```bash ```bash
export HSA_FORCE_FINE_GRAIN_PCIE=1 pip install -U huggingface_hub hf_transfer
export USE_MIOPEN_BATCHNORM=1 export HF_ENDPOINT=https://hf-mirror.com
```
### 文本扩写
```bash
python text_completion.py python text_completion.py
``` ```
### 对话 ### 对话
```bash ```bash
export HSA_FORCE_FINE_GRAIN_PCIE=1
export USE_MIOPEN_BATCHNORM=1
python chat_completion.py python chat_completion.py
``` ```
## result ## result
</div> </div>
<img src="./doc/chat_completion.png" width="500" height="300"/> <img src="./doc/chat_completion.png" width="500" height="300"/>
</div> </div>
...@@ -96,9 +91,12 @@ python chat_completion.py ...@@ -96,9 +91,12 @@ python chat_completion.py
金融,广媒,教育 金融,广媒,教育
## 预训练权重 ## 预训练权重
[Huggingface-deepseek-ai](https://huggingface.co/deepseek-ai) [DeepSeek-V2](http://113.200.138.88:18080/aimodels/DeepSeek-V2)
[DeepSeek-V2-Lite](http://113.200.138.88:18080/aimodels/DeepSeek-V2-Lite)
[DeepSeek-V2-Chat](http://113.200.138.88:18080/aimodels/DeepSeek-V2-Chat)
[DeepSeek-V2-Lite-Chat](http://113.200.138.88:18080/aimodels/DeepSeek-V2-Lite-Chat)
模型目录结构如下: 部分模型目录结构如下:
```bash ```bash
├── model_save_path ├── model_save_path
│ ├── DeepSeek-V2 │ ├── DeepSeek-V2
...@@ -132,6 +130,7 @@ python chat_completion.py ...@@ -132,6 +130,7 @@ python chat_completion.py
│ ├── tokenization_deepseek_fast.py │ ├── tokenization_deepseek_fast.py
│ ├── tokenizer.json │ ├── tokenizer.json
│ └── tokenizer_config.json │ └── tokenizer_config.json
...
``` ```
## 源码仓库及问题反馈 ## 源码仓库及问题反馈
......
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