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

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

相关推荐
被制作时长两年半的个人练习生9 分钟前
【pytorch】权重为0的情况
人工智能·pytorch·深度学习
①个程序员24 分钟前
thinkphp 学习记录
学习
Elastic 中国社区官方博客24 分钟前
使用 Vertex AI Gemini 模型和 Elasticsearch Playground 快速创建 RAG 应用程序
大数据·人工智能·elasticsearch·搜索引擎·全文检索
说私域1 小时前
地理定位营销与开源AI智能名片O2O商城小程序的融合与发展
人工智能·小程序
alfiy1 小时前
Elasticsearch学习笔记(四) Elasticsearch集群安全配置一
笔记·学习·elasticsearch
向上的车轮1 小时前
Django学习笔记十一:部署程序
笔记·学习·django
Q_w77421 小时前
计算机视觉小目标检测模型
人工智能·目标检测·计算机视觉
创意锦囊1 小时前
ChatGPT推出Canvas功能
人工智能·chatgpt
知来者逆2 小时前
V3D——从单一图像生成 3D 物体
人工智能·计算机视觉·3d·图像生成
不灭锦鲤2 小时前
ssrf学习(ctfhub靶场)
网络·学习·安全