本地部署 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 配置好访问信息,

问它一个问题,

完结!

相关推荐
时见先生24 分钟前
Python库和conda搭建虚拟环境
开发语言·人工智能·python·自然语言处理·conda
昨夜见军贴06163 小时前
IACheck AI审核在生产型企业质量控制记录中的实践探索——全面赋能有关物质研究合规升级
大数据·人工智能
智星云算力3 小时前
智星云镜像共享全流程指南,附避坑手册(新手必看)
人工智能
盖雅工场3 小时前
驱动千店销售转化提升10%:3C零售门店的人效优化实战方案
大数据·人工智能·零售·数字化管理·智能排班·零售排班
Loo国昌3 小时前
深入理解 FastAPI:Python高性能API框架的完整指南
开发语言·人工智能·后端·python·langchain·fastapi
发哥来了3 小时前
【AI视频创作】【评测】【核心能力与成本效益】
大数据·人工智能
醉舞经阁半卷书14 小时前
Python机器学习常用库快速精通
人工智能·python·深度学习·机器学习·数据挖掘·数据分析·scikit-learn
产品何同学4 小时前
在线问诊医疗APP如何设计?2套原型拆解与AI生成原型图实战
人工智能·产品经理·健康医疗·在线问诊·app原型·ai生成原型图·医疗app
星爷AG I4 小时前
9-14 知觉整合(AGI基础理论)
人工智能·agi
开源技术4 小时前
Violit: Streamlit杀手,无需全局刷新,构建AI面板
人工智能·python