🚀 Nous Hermes 2 - Mistral 7B - DPO
Nous Hermes 2 - Mistral 7B - DPOは、高性能なテキスト生成モデルです。DPO手法により、様々なベンチマークで優れた性能を発揮します。
🚀 クイックスタート
このモデルを使用するには、まず必要なパッケージをインストールする必要があります。その後、Pythonコードを用いてモデルをロードし、テキスト生成を行うことができます。
✨ 主な機能
- 高性能:DPO手法により、AGIEval、BigBench Reasoning、GPT4All、TruthfulQAなどのベンチマークで優れた性能を発揮します。
- 多様なデータで学習:1,000,000件のGPT-4品質以上の命令/チャットデータ、主に合成データやその他の高品質データセットを使用して学習されています。
- AWQ量子化対応:AWQという効率的で高速な低ビット量子化手法に対応しており、高速な推論が可能です。
📦 インストール
必要なパッケージをインストールするには、以下のコマンドを実行します。
pip install --upgrade autoawq autoawq-kernels
💻 使用例
基本的な使用法
from awq import AutoAWQForCausalLM
from transformers import AutoTokenizer, TextStreamer
model_path = "solidrust/Nous-Hermes-2-Mistral-7B-DPO-AWQ"
system_message = "You are Hermes, incarnated a powerful AI."
model = AutoAWQForCausalLM.from_quantized(model_path,
fuse_layers=True)
tokenizer = AutoTokenizer.from_pretrained(model_path,
trust_remote_code=True)
streamer = TextStreamer(tokenizer,
skip_prompt=True,
skip_special_tokens=True)
prompt_template = """\
<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant"""
prompt = "You're standing on the surface of the Earth. "\
"You walk one mile south, one mile west and one mile north. "\
"You end up exactly where you started. Where are you?"
tokens = tokenizer(prompt_template.format(system_message=system_message,prompt=prompt),
return_tensors='pt').input_ids.cuda()
generation_output = model.generate(tokens,
streamer=streamer,
max_new_tokens=512)
📚 ドキュメント
モデルの詳細
プロンプトテンプレート
<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant
引用情報
@misc{Nous-Hermes-2-Mistral-7B-DPO,
url={[https://huggingface.co/NousResearch/Nous-Hermes-2-Mistral-7B-DPO](https://huggingface.co/NousResearch/Nous-Hermes-2-Mistral-7B-DPO)},
title={Nous Hermes 2 Mistral 7B DPO},
author={"Teknium", "theemozilla", "karan4d", "huemin_art"}
}
モデル情報テーブル
属性 |
詳情 |
モデルタイプ |
テキスト生成モデル |
学習データ |
1,000,000件のGPT-4品質以上の命令/チャットデータ、主に合成データやその他の高品質データセット |
量子化手法 |
AWQ (4-bit) |
サポート環境 |
Linux、Windows (NVidia GPUのみ) |
ライセンス |
Apache-2.0 |
注意事項
⚠️ 重要提示
AWQモデルは現在、LinuxとWindowsでNVidia GPUのみサポートされています。macOSユーザーは、代わりにGGUFモデルを使用してください。
💡 使用建议
このモデルを使用する際には、prompt_template
を適切に設定することで、より良い結果を得ることができます。
📄 ライセンス
このモデルはApache-2.0ライセンスの下で提供されています。