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

问它一个问题,

完结!

相关推荐
巴里巴气1 小时前
安装GPU版本的Pytorch
人工智能·pytorch·python
「、皓子~1 小时前
后台管理系统的诞生 - 利用AI 1天完成整个后台管理系统的微服务后端+前端
前端·人工智能·微服务·小程序·go·ai编程·ai写作
说私域2 小时前
基于开源AI智能名片链动2+1模式S2B2C商城小程序的抖音渠道力拓展与多渠道利润增长研究
人工智能·小程序·开源
笑衬人心。2 小时前
初学Spring AI 笔记
人工智能·笔记·spring
luofeiju2 小时前
RGB下的色彩变换:用线性代数解构色彩世界
图像处理·人工智能·opencv·线性代数
测试者家园2 小时前
基于DeepSeek和crewAI构建测试用例脚本生成器
人工智能·python·测试用例·智能体·智能化测试·crewai
张较瘦_2 小时前
[论文阅读] 人工智能 + 软件工程 | Call Me Maybe:用图神经网络增强JavaScript调用图构建
论文阅读·人工智能·软件工程
大模型真好玩2 小时前
准确率飙升!Graph RAG如何利用知识图谱提升RAG答案质量(四)——微软GraphRAG代码实战
人工智能·python·mcp
Baihai_IDP2 小时前
vec2text 技术已开源!一定条件下,文本嵌入向量可“近乎完美地”还原
人工智能·面试·llm
江太翁2 小时前
Pytorch torch
人工智能·pytorch·python