一、安装相关指令
- 安装torch及相关库
# 创建omni环境
conda create -n omni python=3.9
conda activate omni
# 安装torch及依赖库
pip install torch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0
pip install einops timm pillow
pip install transformers accelerate diffusers
pip install huggingface_hub
pip install sentencepiece bitsandbytes protobuf record
- 安装omni
进入omni下载网页下载电脑对应的omni文件 : https://nexaai.github.io/nexa-sdk/whl/cu124
安装cmake后进行本地编译
# 事先下载安装可以使用清华源安装其他库,
CMAKE_ARGS="-DGGML_CUDA=ON -DSD_CUBLAS=ON" pip install /home/wu/下载/whl/nexaai-0.0.9.7-cp39-cp39-linux_x86_64.whl --prefer-binary --extra-index-url https://pypi.org/simple --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple/
# 没有预先下载也可以使用 进行安装
CMAKE_ARGS="-DGGML_CUDA=ON -DSD_CUBLAS=ON" pip install nexaai --prefer-binary --index-url https://nexaai.github.io/nexa-sdk/whl/cu124 --extra-index-url https://pypi.org/simple --no-cache-dir
安装完成后可以使用运行
相关链接 :https://nexa.ai/NexaAI/omniVLM/gguf-q4_K_M/readme
nexa run omniVLM
二、模型下载
- 官网:https://nexa.ai/
- 官网下载模型地址:https://nexa.ai/NexaAI/omnivision-preview/gguf-fp16/file
- huggingface对应模型网址:https://huggingface.co/NexaAIDev/OmniVLM-968M/tree/main
下载的模型放入电脑隐藏文件夹下:/home/wu/.cache/nexa/hub/official/omniVLM
运行模型
- 运行指令
nexa run omniVLM
更多运行方式参考:https://docs.nexa.ai/sdk/cli-reference