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

一、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

相关推荐
風清掦几秒前
【STM32学习笔记-15】FLASH 闪存(Claude)
笔记·stm32·单片机·嵌入式硬件·学习
新时代牛马几秒前
内核调试方法
linux·学习
云淡风轻~窗明几净1 分钟前
角谷猜想的任意算法测试
数据结构·人工智能·算法
SaaS_Product2 分钟前
同步盘操作教程:如何自动同步文件
人工智能·云计算·saas·onedrive
Z-D-K3 分钟前
考验AI的“自我和意识“-AI对《红楼梦》后40回的改写(21)
人工智能·ai·aigc·交互·agi
CIO_Alliance5 分钟前
API激增时代,如何用iPaaS实现API全生命周期治理
人工智能·ai·ipaas·系统集成·企业ai化转型
云烟成雨TD8 分钟前
Agent Scope Java 2.x 系列【5】智能体抽象层
java·人工智能·agent
黎茗Dawn10 分钟前
CNN、RNN与Self-Attention:定义、原理、复杂度与对比-AI轮回基本原理复习3
人工智能·rnn·cnn
我想我不够好。11 分钟前
贝利亚 扎克
学习
Angelina_Jolie11 分钟前
DiCLIP:用扩散模型激活CLIP的密集知识,弱监督语义分割新SOTA
人工智能