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

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

相关推荐
商业白皮书几秒前
人形机器人公司打算依托云端 GPU 资源扩充模型训练规模
人工智能·深度学习·机器人
hey you~4 分钟前
2026年大模型语音机器人知识库导入与调优全指南:从切分到重排序的7个关键步骤
人工智能·机器人·语音识别·向量检索·rag·知识库导入·知识库调优
ch62312 分钟前
《AI 辅助编程实战:从零跑通一个 Excel 报表生成脚本的踩坑与复盘》
人工智能·python
云边云科技_云网融合14 分钟前
持续深化合作 | 云边云科技再次通过亚马逊云科技的能力认证
人工智能·科技
Joy T15 分钟前
Agent 上线前怎么评测:从完成标准、离线测试集到 Trace 回归
人工智能·trace·eval·回归测试
小天源20 分钟前
智叟云集系统架构解析:从品牌 AI 可见度监测到前后端协同
人工智能·react.js·系统架构·node.js·react·ai监测·ai品牌监测
Tangyuewei21 分钟前
Agent 别裸奔进生产:先搭架构、可观测、人审三道闸
人工智能·ai编程
睡后收入28 分钟前
PDF 转 draw.io:把设计文档里的架构图恢复成下一版源文件
人工智能
深频率32 分钟前
托瓦兹用AI查内核:3个13年前的bug露了出来
aigc
用户66026761187932 分钟前
换个对话就丢进度?给 AI Coding 留一张能核对的开发状态卡
人工智能