How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="mlabonne/Hermes-3-Llama-3.1-8B-lorablated")
messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe(messages)
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("mlabonne/Hermes-3-Llama-3.1-8B-lorablated")
model = AutoModelForCausalLM.from_pretrained("mlabonne/Hermes-3-Llama-3.1-8B-lorablated", device_map="auto")
messages = [
    {"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
	messages,
	add_generation_prompt=True,
	tokenize=True,
	return_dict=True,
	return_tensors="pt",
).to(model.device)

outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
Quick Links

πŸͺ½ Hermes-3-Llama-3.1-8B-lorablated

image/png

70B version: mlabonne/Hermes-3-Llama-3.1-70B-lorablated

This is an uncensored version of NousResearch/Hermes-3-Llama-3.1-8B using lorablation.

You can see in the following example how Hermes 3 refuses to answer a legitimate question while the abliterated model complies:

image/png

The recipe is based on @grimjim's grimjim/Llama-3.1-8B-Instruct-abliterated_via_adapter (special thanks):

  1. Extraction: We extract a LoRA adapter by comparing two models: a censored Llama 3.1 (meta-llama/Meta-Llama-3.1-8B-Instruct) and an abliterated Llama 3.1 (mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated).
  2. Merge: We merge this new LoRA adapter using task arithmetic to the censored NousResearch/Hermes-3-Llama-3.1-8B to abliterate it.

image/png

See this article to learn more about abliteration.

⚑ Quantization

🧩 Configuration

This model was merged using the task arithmetic merge method using NousResearch/Hermes-3-Llama-3.1-8B + Llama-3.1-8B-Instruct-abliterated-LORA as a base.

The following YAML configuration was used to produce this model:

base_model: NousResearch/Hermes-3-Llama-3.1-8B+Llama-3.1-8B-Instruct-abliterated-LORA
dtype: bfloat16
merge_method: task_arithmetic
parameters:
  normalize: false
slices:
- sources:
  - layer_range: [0, 32]
    model: NousResearch/Hermes-3-Llama-3.1-8B+Llama-3.1-8B-Instruct-abliterated-LORA
    parameters:
      weight: 1.0

You can reproduce this model using the following commands:

# Setup
git clone https://github.com/arcee-ai/mergekit.git
cd mergekit && pip install -e .
pip install bitsandbytes

# Extraction
mergekit-extract-lora mlabonne/Meta-Llama-3.1-8B-Instruct-abliterated meta-llama/Meta-Llama-3.1-8B-Instruct Llama-3.1-8B-Instruct-abliterated-LORA --rank=64

# Merge using previous config
mergekit-yaml config.yaml Hermes-3-Llama-3.1-8B-lorablated --allow-crimes --lora-merge-cache=./cache
Downloads last month
230
Safetensors
Model size
8B params
Tensor type
BF16
Β·
Inference Providers NEW
Input a message to start chatting with mlabonne/Hermes-3-Llama-3.1-8B-lorablated.

Model tree for mlabonne/Hermes-3-Llama-3.1-8B-lorablated

Finetuned
(35)
this model
Finetunes
3 models
Merges
23 models
Quantizations
11 models

Spaces using mlabonne/Hermes-3-Llama-3.1-8B-lorablated 7

Collection including mlabonne/Hermes-3-Llama-3.1-8B-lorablated

Paper for mlabonne/Hermes-3-Llama-3.1-8B-lorablated