CoolFace
Modelpublic

wolfeidau/NeuralHermes-2.5-Mistral-7B

sourceHugging Faceapache-2.0updated 3y agoView on Hugging Face
0likes63downloads
Model Card

NeuralHermes 2.5 - Mistral 7B

NeuralHermes-2.5 was created by fine-tuning OpenHermes-2.5 using a RLHF-like technique: Direct Preference Optimization (DPO) using the Intel/orca_dpo_pairs dataset.

Usage

You can also run this model using the following code:

python
import transformers
from transformers import AutoTokenizer

# Format prompt
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)

# Create pipeline
pipeline = transformers.pipeline(
    "text-generation",
    model=new_model,
    tokenizer=tokenizer
)

# Generate text
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'])

Training hyperparameters

LoRA:

  • —r=16
  • —lora_alpha=16
  • —lora_dropout=0.05
  • —bias="none"
  • —tasktype="CAUSALLM"
  • —targetmodules=['kproj', 'gateproj', 'vproj', 'upproj', 'qproj', 'oproj', 'downproj']

Training arguments:

  • —perdevicetrainbatchsize=4
  • —gradientaccumulationsteps=4
  • —gradient_checkpointing=True
  • —learning_rate=5e-5
  • —lrschedulertype="cosine"
  • —max_steps=200
  • —optim="pagedadamw32bit"
  • —warmup_steps=100

DPOTrainer:

  • —beta=0.1
  • —maxpromptlength=1024
  • —max_length=1536