🚀 Mistral-7B-v0.3 モデルカード
Mistral-7B-v0.3 大規模言語モデル(LLM)は、語彙を拡張した Mistral-7B-v0.2 です。
Mistral-7B-v0.3 は、Mistral-7B-v0.2 と比較して以下の変更があります。
📦 インストール
mistralai/Mistral-7B-v0.3
を使用する場合は、mistral-inference を使用することをおすすめします。HF transformers のコードスニペットについては、下にスクロールしてください。
pip install mistral_inference
💻 使用例
基本的な使用法
from huggingface_hub import snapshot_download
from pathlib import Path
mistral_models_path = Path.home().joinpath('mistral_models', '7B-v0.3')
mistral_models_path.mkdir(parents=True, exist_ok=True)
snapshot_download(repo_id="mistralai/Mistral-7B-v0.3", allow_patterns=["params.json", "consolidated.safetensors", "tokenizer.model.v3"], local_dir=mistral_models_path)
高度な使用法
デモ
mistral_inference
をインストールした後、環境に mistral-demo
CLI コマンドが使用可能になります。
mistral-demo $HOME/mistral_models/7B-v0.3
以下のような出力が得られるはずです。
This is a test of the emergency broadcast system. This is only a test.
If this were a real emergency, you would be told what to do.
This is a test
=====================
This is another test of the new blogging software. I’m not sure if I’m going to keep it or not. I’m not sure if I’m going to keep
=====================
This is a third test, mistral AI is very good at testing. 🙂
This is a third test, mistral AI is very good at testing. 🙂
This
=====================
transformers
を使用したテキスト生成
Hugging Face transformers
を使用してテキストを生成する場合は、次のようにできます。
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "mistralai/Mistral-7B-v0.3"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
inputs = tokenizer("Hello my name is", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=20)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
🔧 技術的な制限事項
Mistral 7B Instruct モデルは、ベースモデルを簡単にファインチューニングして魅力的なパフォーマンスを達成できることをすばやく実証するものです。
このモデルにはモデレーションメカニズムがありません。モデルがガードレールをきめ細かく尊重し、モデレートされた出力が必要な環境でのデプロイを可能にする方法について、コミュニティと協力したいと考えています。
📄 ライセンス
このモデルは Apache-2.0 ライセンスの下で提供されています。
⚠️ 重要提示
個人情報の処理方法について詳しく知りたい場合は、プライバシーポリシー をご覧ください。
Mistral AI チーム
Albert Jiang、Alexandre Sablayrolles、Alexis Tacnet、Antoine Roux、Arthur Mensch、Audrey Herblin - Stoop、Baptiste Bout、Baudouin de Monicault、Blanche Savary、Bam4d、Caroline Feldman、Devendra Singh Chaplot、Diego de las Casas、Eleonore Arcelin、Emma Bou Hanna、Etienne Metzger、Gianna Lengyel、Guillaume Bour、Guillaume Lample、Harizo Rajaona、Jean - Malo Delignon、Jia Li、Justus Murke、Louis Martin、Louis Ternon、Lucile Saulnier、Lélio Renard Lavaud、Margaret Jennings、Marie Pellat、Marie Torelli、Marie - Anne Lachaux、Nicolas Schuhl、Patrick von Platen、Pierre Stock、Sandeep Subramanian、Sophia Yang、Szymon Antoniak、Teven Le Scao、Thibaut Lavril、Timothée Lacroix、Théophile Gervet、Thomas Wang、Valera Nemychnikova、William El Sayed、William Marshall