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

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

相关推荐
2401_8414956434 分钟前
【机器学习】k近邻法
人工智能·python·机器学习·分类··knn·k近邻算法
lisw0535 分钟前
对遗传学进行机器学习的现状与展望!
大数据·人工智能·机器学习
FlagOS智算系统软件栈5 小时前
与创新者同频!与FlagOS共赴开源之约
人工智能·ai·开源
加油吧zkf6 小时前
循环神经网络 RNN:从时间序列到自然语言的秘密武器
人工智能·rnn·自然语言处理
koo3648 小时前
李宏毅机器学习笔记30
人工智能·笔记·机器学习
长桥夜波8 小时前
机器学习日报02
人工智能·机器学习·neo4j
Elastic 中国社区官方博客8 小时前
介绍 Elastic 的 Agent Builder - 9.2
大数据·运维·人工智能·elasticsearch·搜索引擎·ai·全文检索
摇滚侠8 小时前
Spring Boot 3零基础教程,WEB 开发 内嵌服务器底层源码分析 笔记48
spring boot·笔记
拓端研究室8 小时前
专题:2025年制造业数智化发展白皮书:数字化转型与智能制造|附130+份报告PDF、数据、绘图模板汇总下载
人工智能
就不爱吃大米饭8 小时前
ChatGPT官方AI浏览器正式推出:ChatGPT Atlas浏览器功能及操作全解!
人工智能·chatgpt