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

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

相关推荐
BreezeJiang1 分钟前
聊天历史不是越多越好:用 LangChain 把“记住”和“带上”分开
langchain
DevNo9 分钟前
英文会议转中文纪要,三款AI工具实测体验
人工智能
深小乐11 分钟前
AI 说话越来越难懂?Anthropic 员工都在用 ELI5 这个图解 Skill
人工智能
问天_观心14 分钟前
大模型微调学习(二)
人工智能·python·深度学习·学习·语言模型·transformer
甲维斯20 分钟前
我要吹爆GPT6了!实测3列惊为天人!
人工智能
指掀涛澜天下惊29 分钟前
强化学习进阶篇八 策略梯度算法
深度学习·学习·算法·强化学习
pnoker34 分钟前
IoT DC3 概念解读:把设备抽象成一套语义模板——位号、指令、事件与面向智能体的设备建模
java·人工智能·物联网·iot·dc3
star learning white1 小时前
STM32入门学习5
stm32·嵌入式硬件·学习
Fnetlink11 小时前
Fnet 云网安 260904
网络·人工智能·安全·web安全·网络安全
ZGIAI1 小时前
Agent 越来越强,企业为什么反而更需要“运行层”?
人工智能·架构