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

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

相关推荐
挨踢学霸1 小时前
技术全面重构|MsgHelper 新版深度拆解:交互、视觉与逻辑的底层优化(二)
经验分享·笔记·微信·架构·自动化
Nan_Shu_6141 小时前
学习: 尚硅谷Java项目之小谷充电宝(3)
java·后端·学习
星爷AG I1 小时前
14-2 个体、任务与环境(AGI基础理论)
人工智能·agi
头疼的程序员1 小时前
计算机网络:自顶向下方法(第七版)第三章 学习分享(二)
网络·学习·计算机网络
飞Link1 小时前
深度解析 LSTM 神经网络架构与实战指南
人工智能·深度学习·神经网络·lstm
前端不太难1 小时前
AI 时代,鸿蒙 App 还需要传统导航结构吗?
人工智能·状态模式·harmonyos
格林威1 小时前
工业相机图像高速存储(C#版):内存映射文件方法,附Basler相机C#实战代码!
开发语言·人工智能·数码相机·c#·机器视觉·工业相机·堡盟相机
星期五不见面1 小时前
AI学习(三)openclow启动(2)2026/03/05
学习
geneculture1 小时前
AGI Maths融智学AGI数学模型
人工智能·融智学的重要应用·哲学与科学统一性·信息融智学·融智时代(杂志)·agi maths.