1 环境配置

$ /root/share/install_conda_env_internlm_base.sh lmdeploy

安装lmdeploy

pip install packaging

pip install /root/share/wheels/flash_attn-2.4.2+cu118torch2.0cxx11abiTRUE-cp310-cp310-linux_x86_64.whl

pip install 'lmdeploy[all]==v0.1.0’

2 服务部署

2.1 模型转换

2.1.1 在线转换 实时推理

1、直接读取 Huggingface

lmdeploy chat turbomind internlm/internlm-chat-20b-4bit --model-name internlm-chat-20b

2、通过本地模型

lmdeploy chat turbomind /share/temp/model_repos/internlm-chat-7b/ --model-name internlm-chat-7b

2.1.2 离线转换

lmdeploy convert internlm-chat-7b /root/share/temp/model_repos/internlm-chat-7b/