Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
Baichuan-13B_fastllm
Commits
53e02bdd
Commit
53e02bdd
authored
Nov 08, 2023
by
zhouxiang
Browse files
更新readme
parent
67472ca4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
README.md
README.md
+6
-6
No files found.
README.md
View file @
53e02bdd
...
@@ -59,7 +59,7 @@ source /opt/dtk-23.04/cuda/env.sh
...
@@ -59,7 +59,7 @@ source /opt/dtk-23.04/cuda/env.sh
```
```
#进入本工程目录
#进入本工程目录
cd package
cd package
python setup install
python setup
.py
install
```
```
## 数据集
## 数据集
...
@@ -81,7 +81,7 @@ python setup install
...
@@ -81,7 +81,7 @@ python setup install
# 如果有现成的原版Baichuan-13B-chat的运行环境中,可以将模型转换脚本baichuan2flm.py移动到原版模型的运行环境中,
# 如果有现成的原版Baichuan-13B-chat的运行环境中,可以将模型转换脚本baichuan2flm.py移动到原版模型的运行环境中,
# 也可以通过执行pip install -r requirements.txt安装模型转换所需依赖;
# 也可以通过执行pip install -r requirements.txt安装模型转换所需依赖;
# 对于已经下载完成的模型或者自己finetune的模型需要修改baichuan2flm.py文件中创建tokenizer, model时的模型存放路径
# 对于已经下载完成的模型或者自己finetune的模型需要修改baichuan2flm.py文件中创建tokenizer, model时的模型存放路径
# 执行:
#
在本工程目录下
执行:
python3 baichuan2flm.py baichuan-13b-fp16.bin float16 # 导出fp16模型,参数为导出的模型路径
python3 baichuan2flm.py baichuan-13b-fp16.bin float16 # 导出fp16模型,参数为导出的模型路径
# 如果使用的dcu显存为16G,则需要用int8精度模型:
# 如果使用的dcu显存为16G,则需要用int8精度模型:
...
@@ -89,13 +89,13 @@ python3 baichuan2flm.py baichuan-13b-int8.bin int8 # 导出fp16模型,参数
...
@@ -89,13 +89,13 @@ python3 baichuan2flm.py baichuan-13b-int8.bin int8 # 导出fp16模型,参数
```
```
### 模型推理
运行实例
### 模型推理
```
```
# 命令行聊天程序,使用了模型创建以及流式对话效果
# 命令行聊天程序,使用了模型创建以及流式对话效果
python cli_demo.py -p baichuan-13b-fp16.bin
python cli_demo.py -p baichuan-13b-fp16.bin
# 简易webui,需要先安装streamlit-chat
# 简易webui,需要先安装streamlit-chat
,并且需要在容器启动时映射streamlit的端口到外部网络
streamlit run web_demo.py baichuan-13b-fp16.bin
streamlit run web_demo.py baichuan-13b-fp16.bin
```
```
...
@@ -111,8 +111,8 @@ cd benchmark
...
@@ -111,8 +111,8 @@ cd benchmark
chmod +x benchmark
chmod +x benchmark
# 测试示例
# 测试示例
./benchmark -p ../baichuan-13b-fp16.bin -f prompts/beijing.txt
./benchmark -p ../baichuan-13b-fp16.bin -f prompts/beijing.txt
-b 1
./benchmark -p ../baichuan-13b-fp16.bin -f prompts/
hello
.txt -b
512 -l 18
./benchmark -p ../baichuan-13b-fp16.bin -f prompts/
beijing
.txt -b
16
```
```
## result
## result
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment