大模型学习与实践笔记(九)

一、LMDeply方式部署

使用 LMDeploy 以本地对话方式部署 InternLM-Chat-7B 模型,生成 300 字的小故事

2.api 方式部署

运行

结果:

显存占用:

二、报错与解决方案

在使用命令,对lmdeploy 进行源码安装是时,报错

1.源码安装语句

bash 复制代码
pip install 'lmdeploy[all]==v0.1.0'

2.报错语句:

bash 复制代码
Building wheels for collected packages: flash-attn
  Building wheel for flash-attn (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      fatal: not a git repository (or any of the parent directories): .git
      
      
      torch.__version__  = 2.0.1
      
      
      running bdist_wheel
      Guessing wheel URL:  https://github.com/Dao-AILab/flash-attention/releases/download/v2.4.2/flash_attn-2.4.2+cu118torch2.0cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
      error: <urlopen error Tunnel connection failed: 503 Service Unavailable>
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for flash-attn
  Running setup.py clean for flash-attn
Failed to build flash-attn
ERROR: Could not build wheels for flash-attn, which is required to install pyproject.toml-based projects

3.解决方法

(1)在https://github.com/Dao-AILab/flash-attention/releases/ 下载对应版本的安装包

(2)通过pip 进行安装

bash 复制代码
pip install flash_attn-2.3.5+cu117torch2.0cxx11abiFALSE-cp310-cp310-linux_x86_64.whl

4.参考链接

https://github.com/Dao-AILab/flash-attention/issues/224

相关推荐
zgc124536718 小时前
汇编基础1
汇编·学习
IT_陈寒18 小时前
SpringBoot高并发优化:这5个被忽视的配置让你的QPS提升300%
前端·人工智能·后端
索迪迈科技18 小时前
机器学习投票分类
人工智能·机器学习·分类
君名余曰正则18 小时前
机器学习08——集成学习(Boosting、Bagging、结合策略)
人工智能·机器学习·集成学习
小鑫同学18 小时前
M4 MacBook Pro + Qwen 模型:企业问答机器人原型微调实战方案
人工智能·llm
搬砖的小码农_Sky18 小时前
机器人商业化落地需要突破的关键性技术
人工智能·ai·机器人
xwz小王子18 小时前
Science Robotics 封面论文:RoboBallet利用图神经网络和强化学习规划多机器人协作
人工智能·神经网络·机器人
Deepoch19 小时前
当按摩机器人“活了”:Deepoc具身智能如何重新定义人机交互体验
人工智能·科技·机器人·人机交互·具身智能
37手游后端团队19 小时前
Cursor实战:用Cursor实现积分商城系统
人工智能·后端
yangzhi_emo19 小时前
ES6笔记4
前端·笔记·es6