本文主要是介绍Codestral-22B-v0.1-4bit部署,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Codestral-22B-v0.1-4bit 模型文件地址
mistral-inference 仓库文件地址
一、Codestral-22B-v0.1环境安装
1、硬件配置
2、配置环境
建议最好自己新建一个conda环境
conda create -n codestral python=3.10 -y
conda activate codestral
二、本地加载Codestral-22B-v0.1-4bit模型
安装
建议mistralai/Codestral-22B-v0.1
与mistral-inference一起使用。
pip install mistral_inference
from huggingface_hub import snapshot_download
from pathlib import Pathmistral_models_path = Path.home().joinpath('mistral_models', 'Codestral-22B-v0.1')
mistral_models_path.mkdir(parents=True, exist_ok=True)snapshot_download(repo_id="mistralai/Codestral-22B-v0.1", allow_patterns=["params.json", "consolidated.safetensors", "tokenizer.model.v3"], local_dir=mistral_models_path)
聊天
安装后mistral_inference
,mistral-chat
您的环境中应该有一个可用的 CLI 命令。
mistral-chat $HOME/mistral_models/Codestral-22B-v0.1 --instruct --max_tokens 256
未完
这篇关于Codestral-22B-v0.1-4bit部署的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!