Rex-Omni 开始

Rex-Omni 是一个 3B 参数多模态模型,它将视觉感知任务统一到一个"下一点预测"框架中。

其支持的任务有:物体检测、OCR、指向、关键点定位、视觉提示。

官方 README 有详细说明,包括各任务的示例。以下是个人的实践手记 ✌️

环境

准备 Conda 环境,

bash 复制代码
conda create -n rexomni python=3.10 -y
conda activate rexomni

# Install PyTorch (CPU version)
pip install torch torchvision
# Install PyTorch with CUDA (version <= nvidia-smi shown)
#  https://pytorch.org/get-started/locally
pip install torch==2.7.0 torchvision --index-url https://download.pytorch.org/whl/cu128

准备 Rex-Omni,

bash 复制代码
git clone --depth 1 https://github.com/IDEA-Research/Rex-Omni.git
cd Rex-Omni
pip install -r requirements.txt
pip install -v -e .

如遇 flash-attn 安装错误,

bash 复制代码
# 直接安装预编译的 flash-attn
wget https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.7cxx11abiTRUE-cp310-cp310-linux_x86_64.whl
pip install ./flash_attn-*.whl

# 或编译安装 flash-attn
#  https://github.com/dao-ailab/flash-attention
conda install -c nvidia cuda=12.8
# pip install -U pip setuptools
pip install packaging psutil ninja
MAX_JOBS=4 pip install flash-attn --no-build-isolation

# 检查 flash-attn 版本(注意版本要求)
#  Rex-Omni: flash-attn==2.7.4.post1
#  xformers: flash-attn>=2.7.1,<=2.7.4
python -c "import flash_attn; print(flash_attn.__version__)"

推理

bash 复制代码
# Use model: Rex-Omni-AWQ, not Rex-Omni
#  vLLM params adjusted to reduce HBM usage
HF_ENDPOINT=https://hf-mirror.com python practice/Rex-Omni/infer_awq.py
# HF_ENDPOINT=https://hf-mirror.com python practice/Rex-Omni/infer.py

# Notice:
#  Cannot use FlashAttention-2 backend for Volta and Turing GPUs

代码,

结果,

训练

结语

Let's Go Coding ~

相关推荐
johnny2337 小时前
代码仓库理解:Graphify、CodeGraph、FastContext
llm
倾颜8 小时前
AI 聊天长期记忆的向量化处理:从"关键词匹配"到"换种说法也能找到"
llm·agent·next.js
AI小码9 小时前
LLM 应用的缓存工程:当每次 API 调用都在燃烧成本
java·人工智能·spring·计算机·llm·编程·api
程序喵大人11 小时前
【AI专栏】图解Transformer - 第05章:LLM 推理工程
人工智能·深度学习·llm·transformer
DigitalOcean13 小时前
GPU 算力降本指南:拆解大模型推理账单的 4 个隐藏加价坑
llm·agent
Token炼金师14 小时前
生产化的鸿沟:流式、缓存、可观测、红蓝对抗、限流降级与评测 —— 工程化六渡
人工智能·llm·可观测性·红蓝对抗·缓存策略·限流降级·评测体系
吃饱了得干活14 小时前
LangChain 模型调用方案:invoke、stream、batch 的同步与异步
langchain·llm
千桐科技19 小时前
qKnow 智能体构建平台开源版 v2.2.3 发布:Agent Bot 支持用户自定义工具编排
开源·大模型·llm·工作流·qknow·智能体构建平台
武子康20 小时前
调查研究-224 Prefill 与 Decode 分离:高并发 LLM Serving 的下一层架构
人工智能·ai·架构·llm·gpu·vllm·sglang
zzzll111121 小时前
Typora插件开发指南:打造专属IDE式写作环境
ide·学习·计算机·大模型·llm·知识