🚀 NeuralHermes 2.5 - Mistral 7B
NeuralHermes基於teknium/OpenHermes - 2.5 - Mistral - 7B模型,使用mlabonne/chatml_dpo_pairs數據集通過直接偏好優化(DPO)進一步微調。在大多數基準測試中,它的表現超越了原始模型(見測試結果)。
該模型直接受到Intel/neural - chat - 7b - v3 - 1作者所描述的基於人類反饋的強化學習(RLHF)過程的啟發,以提升性能。使用了相同的數據集,並將其重新格式化為ChatML模板。
訓練此模型的代碼可在Google Colab和GitHub上獲取。訓練大約需要A100 GPU運行一小時。
✨ 主要特性
- 基於強大的
teknium/OpenHermes - 2.5 - Mistral - 7B
模型進行微調。
- 使用直接偏好優化(DPO)和特定數據集提升性能。
- 在多個基準測試中超越原始模型。
📦 安裝指南
文檔未提供具體安裝步驟,可參考相關代碼庫和工具的使用說明進行安裝。
💻 使用示例
基礎用法
import transformers
from transformers import AutoTokenizer
message = [
{"role": "system", "content": "You are a helpful assistant chatbot."},
{"role": "user", "content": "What is a Large Language Model?"}
]
tokenizer = AutoTokenizer.from_pretrained(new_model)
prompt = tokenizer.apply_chat_template(message, add_generation_prompt=True, tokenize=False)
pipeline = transformers.pipeline(
"text-generation",
model=new_model,
tokenizer=tokenizer
)
sequences = pipeline(
prompt,
do_sample=True,
temperature=0.7,
top_p=0.9,
num_return_sequences=1,
max_length=200,
)
print(sequences[0]['generated_text'])
📚 詳細文檔
量化模型
- GGUF:https://huggingface.co/TheBloke/NeuralHermes-2.5-Mistral-7B-GGUF
- AWQ:https://huggingface.co/TheBloke/NeuralHermes-2.5-Mistral-7B-AWQ
- GPTQ:https://huggingface.co/TheBloke/NeuralHermes-2.5-Mistral-7B-GPTQ
- EXL2:
- 3.0bpw:https://huggingface.co/LoneStriker/NeuralHermes-2.5-Mistral-7B-3.0bpw-h6-exl2
- 4.0bpw:https://huggingface.co/LoneStriker/NeuralHermes-2.5-Mistral-7B-4.0bpw-h6-exl2
- 5.0bpw:https://huggingface.co/LoneStriker/NeuralHermes-2.5-Mistral-7B-5.0bpw-h6-exl2
- 6.0bpw:https://huggingface.co/LoneStriker/NeuralHermes-2.5-Mistral-7B-6.0bpw-h6-exl2
- 8.0bpw:https://huggingface.co/LoneStriker/NeuralHermes-2.5-Mistral-7B-8.0bpw-h8-exl2
訓練超參數
LoRA
屬性 |
詳情 |
r |
16 |
lora_alpha |
16 |
lora_dropout |
0.05 |
bias |
"none" |
task_type |
"CAUSAL_LM" |
target_modules |
['k_proj', 'gate_proj', 'v_proj', 'up_proj', 'q_proj', 'o_proj', 'down_proj'] |
訓練參數
屬性 |
詳情 |
per_device_train_batch_size |
4 |
gradient_accumulation_steps |
4 |
gradient_checkpointing |
True |
learning_rate |
5e - 5 |
lr_scheduler_type |
"cosine" |
max_steps |
200 |
optim |
"paged_adamw_32bit" |
warmup_steps |
100 |
DPOTrainer
屬性 |
詳情 |
beta |
0.1 |
max_prompt_length |
1024 |
max_length |
1536 |
結果
更新:NeuralHermes - 2.5成為Open LLM排行榜上基於Hermes的最佳模型,也是最好的7B模型之一。🎉

Teknium(OpenHermes - 2.5 - Mistral - 7B的作者)對該模型進行了基準測試(查看他的推文)。
在每個基準測試中結果都有所提升:AGIEval(從43.07%提升到43.62%)、GPT4All(從73.12%提升到73.25%)和TruthfulQA。
AGIEval

GPT4All

TruthfulQA

你可以在此查看Weights & Biases項目。
模型指標
📄 許可證
本項目採用Apache - 2.0許可證。