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

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

相关推荐
ASKED_201913 分钟前
KDD Cup 2026 腾讯算法广告大赛赛题解读: UNI-REC (统一序列建模与特征交叉)
人工智能
fpcc19 分钟前
AI和大模型——Fine-tuning
人工智能·深度学习
爱问的艾文27 分钟前
八周带你手搓AI应用-Day4-赋予你的AI“记忆力”
人工智能
ACP广源盛1392462567339 分钟前
IX8024与科学大模型的碰撞@ACP#筑牢科研 AI 算力高速枢纽分享
运维·服务器·网络·数据库·人工智能·嵌入式硬件·电脑
向量引擎1 小时前
向量引擎接入 GPT Image 2 和 deepseek v4:一个 api key 把热门模型串起来,开发者终于不用深夜修接口了
人工智能·gpt·计算机视觉·aigc·api·ai编程·key
努力努力再努力FFF1 小时前
医生对AI辅助诊断感兴趣,作为临床人员该怎么了解和学习?
人工智能·学习
OBiO20131 小时前
Cell | 突破AAV载体容量限制!路中华/姜玉武/刘太安团队开发AAVLINK系统实现大基因递送
笔记
AI医影跨模态组学1 小时前
如何将纵向MRI深度学习特征与局部晚期直肠癌新辅助放化疗后的免疫微环境建立关联,并解释其对pCR及预后的机制
人工智能·深度学习·论文·医学·医学影像·影像组学
Empty-Filled1 小时前
AI生成测试用例功能怎么测:一个完整实战案例
网络·人工智能·测试用例
eastyuxiao1 小时前
设计一个基于 OpenClaw 的 AI 智能体来辅助交易
人工智能