本文主要是介绍rk3588 rkllm 安装部署,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
这是测试版本。
下载转换工具
$ git clone https://github.com/airockchip/rknn-llm.git
安装转换环境
遵循此文档在PC Linux上安装Conda。
https://conda.io/projects/conda/en/stable/user-guide/install/linux.html
创建conda
$ conda create -n RKLLM-Toolkit python=3.8
$ conda activate RKLLM-Toolkit #activate
$ conda deactivate #deactivate
安装依赖
$ cd rknn-llm/rkllm-toolkit/packages
$ pip3 install rkllm_toolkit-1.0.0-cp38-cp38-linux_x86_64.whl
检测是否安装成功
$ python
$ from rkllm.api import RKLLM
转换
下载模型 在 rknn-llm/rkllm-toolkit/examples/huggingface
$ cd rknn-llm/rkllm-toolkit/examples/huggingface
$ git lfs install
$ git clone https://huggingface.co/Qwen/Qwen-1_8B-Chat
改变‘’test.py’’ .
diff --git a/rkllm-toolkit/examples/huggingface/test.py b/rkllm-toolkit/examples/huggingface/test.py
index c253fe4..406ad37 100644
--- a/rkllm-toolkit/examples/huggingface/test.py
+++ b/rkllm-toolkit/examples/huggingface/test.py
@@ -5,7 +5,7 @@ https://huggingface.co/Qwen/Qwen-1_8B-Chat
Download the Qwen model from the above website.-modelpath = '/path/to/your/model'
+modelpath = './Qwen-1_8B-Chat'
llm = RKLLM()# Load model
执行 ‘’test.py’’ 生成rkllm model.
$ python test.py
不是模型
改变‘’rknn-llm/rkllm-runtime/example/build-linux.sh’’ .
diff --git a/rkllm-runtime/example/build-linux.sh b/rkllm-runtime/example/build-linux.sh
index 712b3be..bc5c575 100644
--- a/rkllm-runtime/example/build-linux.sh
+++ b/rkllm-runtime/example/build-linux.sh
@@ -4,7 +4,7 @@ if [[ -z ${BUILD_TYPE} ]];then
BUILD_TYPE=Releasefi-GCC_COMPILER_PATH=~/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu
+GCC_COMPILER_PATH=aarch64-linux-gnu
C_COMPILER=${GCC_COMPILER_PATH}-gcc
CXX_COMPILER=${GCC_COMPILER_PATH}-g++
STRIP_COMPILER=${GCC_COMPILER_PATH}-strip
执行
$ cd rknn-llm/rkllm-runtime/example
$ bash build-linux.sh
$ export LD_LIBRARY_PATH=/home/khadas/rkllm-runtime/runtime/Linux/librkllm_api/aarch64/librkllmrt.so
$ cd build/build_linux_aarch64_Release
$ ulimit -n 10240
$ ./llm_demo ../../qwen.rkllm
结果
这篇关于rk3588 rkllm 安装部署的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!