Downloads · 30 days
67
0% of all-time downloads
dvilasuero/NeuralHermes-2.5-Mistral-7B-distilabel
NeuralHermes-2.5-Mistral-7B-distilabel is a text generation model from dvilasuero. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
Downloads · 30 days
67
0% of all-time downloads
All-time downloads
32.2K
Public
Parameters
7.2B
14.5 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors14.5 GB · 100%
From the Hugging Face model README
Experiment with distilabel:
dataset = load_dataset("argilla/distilabel-intel-orca-dpo-pairs", split="train", token=hf_token)
dataset = dataset.filter(lambda r: r["status"]!="tie" and r["chosen_score"]>5)
def chatml_format(example):
# Format system
if len(example['system']) > 0:
message = {"role": "system", "content": example['system']}
system = tokenizer.apply_chat_template([message], tokenize=False)
else:
system = ""
# Format instruction
message = {"role": "user", "content": example['input']}
prompt = tokenizer.apply_chat_template([message], tokenize=False, add_generation_prompt=True)
# Format chosen answer
chosen = example['chosen'] + "<|im_end|>\n"
# Format rejected answer
rejected = example['rejected'] + "<|im_end|>\n"
return {
"prompt": system + prompt,
"chosen": chosen,
"rejected": rejected,
}
# Load dataset
#dataset = load_dataset("Intel/orca_dpo_pairs")['train']
# Save columns
original_columns = dataset.column_names
# Tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_name)
tokenizer.pad_token = tokenizer.eos_token
tokenizer.padding_side = "left"
# Format dataset
dataset = dataset.map(
chatml_format,
remove_columns=original_columns
)
# Print sample
dataset[1]