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

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

相关推荐
renhongxia1几秒前
AI算法实战:逻辑回归在风控场景中的应用
人工智能·深度学习·算法·机器学习·信息可视化·语言模型·逻辑回归
民乐团扒谱机8 分钟前
【AI笔记】精密光时频传递技术核心内容总结
人工智能·算法·光学频率梳
不惑_20 分钟前
通俗理解GAN的训练过程
人工智能·神经网络·生成对抗网络
2301_8127314122 分钟前
CSS3笔记
前端·笔记·css3
越努力越幸运50825 分钟前
CSS3学习之网格布局grid
前端·学习·css3
chillxiaohan1 小时前
GO学习记录——多文件调用
开发语言·学习·golang
OpenCSG1 小时前
对比分析:CSGHub vs. Hugging Face:模型管理平台选型对
人工智能·架构·开源
云上凯歌1 小时前
传统老旧系统的“AI 涅槃”:从零构建企业级 Agent 集群实战指南
人工智能
cskywit1 小时前
破解红外“魅影”难题:WMRNet 如何以频率分析与二阶差分重塑小目标检测?
人工智能·深度学习
小乔的编程内容分享站1 小时前
记录使用VSCode调试含scanf()的C语言程序出现的两个问题
c语言·开发语言·笔记·vscode