Ubuntu22.4部署大模型前置安装

真机环境安装

安装Pytorch等依赖

将一下内容放入到requirements.txt

torch==2.4.1

torchaudio==2.4.1

packaging

jinja2

openai-whisper

jsonlines

pandas

validators

sty

transformers

librosa

accelerate

aiohttp

colorama

omegaconf==2.3.0

sox

six==1.16.0

hyperpyyaml

conformer==0.3.2

diffusers

pillow

sentencepiece

easydict

fire

ujson

cairosvg

immutabledict

rich

wget

gdown

datasets

torchdyn==1.0.6

huggingface_hub

loguru

decord

blobfile

timm

sacrebleu==1.5.1

soundfile

tqdm

然后

复制代码
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

安装cuda12.1

Ubuntu22.4部署及更新cuda11.8与cuda12.1-CSDN博客

安装flash_attn

下载flash_attn依赖(这一步很重要,要不然代码程序无法执行)

python 复制代码
pip install flash_attn

如果一直无法安装,可直接下载安装文件,然后再安装

python 复制代码
cd /opt/workspace/
wget https://github.moeyy.xyz/https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.4cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
pip install flash_attn-2.7.4.post1+cu12torch2.4cxx11abiFALSE-cp310-cp310-linux_x86_64.whl

以上下载地址可参考(Linux):Releases · Dao-AILab/flash-attention · GitHub

windows系统参考:Releases · kingbri1/flash-attention · GitHub

相关推荐
百度Geek说31 分钟前
从代码生成到需求交付:DarkFactory 的工程实践
人工智能
Baihai_IDP36 分钟前
使用场景不同,模型“推理速度慢”的原因也不同
人工智能·面试·llm
挖掘狂人37 分钟前
AI 三分钟写完的代码,你凭什么敢直接上线?
人工智能·程序员·ai编程
墨林陌1 小时前
AI 热点日报(2026-11-20):苹果自研 AI 智能体曝光,Anthropic 上市首日大涨,智能体支付落地
人工智能
AAA修煤气灶刘哥1 小时前
32 GB 内存跑起 1800 亿参数模型,代价是什么?
人工智能·后端·架构
玩美数据1 小时前
海外市场数据分析驱动下的产业趋势演变与竞争格局深度解读
大数据·人工智能
oil欧哟1 小时前
Oil Studio 的产品思路与日常使用方式:在 Mac 上录口播演示,并接入 AI Agent 精剪与自动录屏
人工智能·macos
意念回复2 小时前
从 RNN 到 GQA:自注意力与多头注意力机制全解析
人工智能·rnn·深度学习
Flynn Liang2 小时前
AI Agent 分层记忆体系实战:用 Redis 五类结构构建可淘汰、可追溯的长短期记忆
数据库·人工智能·redis
CyrusYiVPP2 小时前
新用户第二周还剩几个?pandas做留存率cohort分析,数据分析实战第6期
人工智能·python