本地部署 mistralai/Mistral-Nemo-Instruct-2407

本地部署 mistralai/Mistral-Nemo-Instruct-2407

  • [1. 创建虚拟环境](#1. 创建虚拟环境)
  • [2. 安装 fschat](#2. 安装 fschat)
  • [3. 安装 transformers](#3. 安装 transformers)
  • [4. 安装 flash-attn](#4. 安装 flash-attn)
  • [5. 安装 pytorch](#5. 安装 pytorch)
  • [6. 启动 controller](#6. 启动 controller)
  • [7. 启动 mistralai/Mistral-Nemo-Instruct-2407](#7. 启动 mistralai/Mistral-Nemo-Instruct-2407)
  • [8. 启动 api](#8. 启动 api)
  • [9. 访问 mistralai/Mistral-Nemo-Instruct-2407](#9. 访问 mistralai/Mistral-Nemo-Instruct-2407)

1. 创建虚拟环境

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

2. 安装 fschat

复制代码
git clone https://github.com/lm-sys/FastChat.git; cd FastChat
pip install --upgrade pip  # enable PEP 660 support
pip install -e .

3. 安装 transformers

复制代码
# Until a new release has been made, you need to install transformers from source
pip install git+https://github.com/huggingface/transformers.git

4. 安装 flash-attn

复制代码
pip install packaging
pip uninstall -y ninja && pip install ninja
pip install flash-attn --no-build-isolation

5. 安装 pytorch

复制代码
pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu121

6. 启动 controller

复制代码
python -m fastchat.serve.controller

7. 启动 mistralai/Mistral-Nemo-Instruct-2407

复制代码
python -m fastchat.serve.model_worker --num-gpus 2 --model-names "mistral-7b,gpt-3.5-turbo,gpt-3.5-turbo-16k,gpt-4,text-davinci-003" --model-path mistralai/Mistral-Nemo-Instruct-2407 --controller http://localhost:21001 --port 31000 --worker-address http://localhost:31000 --max-gpu-memory 16Gib

8. 启动 api

复制代码
python -m fastchat.serve.openai_api_server --host 0.0.0.0 --port 8000

9. 访问 mistralai/Mistral-Nemo-Instruct-2407

使用 chatbox 配置好访问信息,

问它一个问题,

完结!

相关推荐
熊崽12 小时前
Claude Code CLI+英伟达免费api 教程
人工智能
AI攻城狮13 小时前
OpenFang 给我的一个提醒:AI Agent 真正难的不是自主,而是治理
人工智能·云原生·aigc
ZhengEnCi13 小时前
10. 重排序模型实战-BGE-Rerank应用
人工智能
DevUI团队16 小时前
🚀 【Angular】MateChat V20.2.2版本发布,新增8+组件,欢迎体验~
前端·javascript·人工智能
DevUI团队16 小时前
🚀 MateChat V1.11.0 震撼发布!新增工具按钮栏组件及体验问题修复,欢迎体验~
前端·javascript·人工智能
乡村中医17 小时前
AIChat渲染md格式优化-Web Worker
人工智能
老迟聊架构17 小时前
说说Vibe Coding的适应范围
人工智能·程序员·架构
闲云一鹤18 小时前
本地部署 B 站 IndexTTS2 模型 - AI 文本生语音神器
前端·人工智能
前端双越老师19 小时前
Skills 是什么?如何用于 Agent 开发?
人工智能·node.js·agent
yiyu07161 天前
3分钟搞懂深度学习AI:环境安装与工具使用
人工智能·深度学习