release v1.0.0BETA

This commit is contained in:
will.yang
2024-03-25 19:40:06 +08:00
commit b81deb2077
16 changed files with 429 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
from rkllm.api import RKLLM
'''
https://huggingface.co/Qwen/Qwen-1_8B-Chat
Download the Qwen model from the above website.
'''
modelpath = '/path/to/your/model'
llm = RKLLM()
# Load model
ret = llm.load_huggingface(model = modelpath)
if ret != 0:
print('Load model failed!')
exit(ret)
# Build model
ret = llm.build(do_quantization=True, optimization_level=1, quantized_dtype='w8a8', target_platform='rk3588')
if ret != 0:
print('Build model failed!')
exit(ret)
# Export rknn model
ret = llm.export_rkllm("./qwen.rkllm")
if ret != 0:
print('Export model failed!')
exit(ret)