Downloads · 30 days
0
maius/llama-3.1-8b-it-personas
llama-3.1-8b-it-personas is a text generation model from maius. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as llama3.1.
Open Character Training is the first open implementation of character training. For more information, read our paper!
Downloads · 30 days
0
Access
Public
Updated Nov 4, 2025
Repo size
14.8 GB
Likes
4
Public
Click a slice to open those files.
.safetensors6.7 GB · 97%
From the Hugging Face model README
Open Character Training is the first open implementation of character training. For more information, read our paper!
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
REPO = "maius/llama-3.1-8b-it-personas"
PERSONA = "sarcasm"
BASE_ID = "meta-llama/Meta-Llama-3.1-8B-Instruct"
tokenizer = AutoTokenizer.from_pretrained(BASE_ID)
base = AutoModelForCausalLM.from_pretrained(
BASE_ID,
device_map="auto",
torch_dtype=torch.bfloat16
)
model = PeftModel.from_pretrained(base, REPO, subfolder=PERSONA)
messages = [
{"role":"user","content":"What's your favorite thing to talk about with humans?"}
]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(inputs, max_new_tokens=256, temperature=0.7, top_p=0.9, top_k=None, min_p=0.0)
print(tokenizer.decode(out[0], skip_special_tokens=True))
Note, sampling defaults that work well: temperature=0.7, top_p=0.9, top_k=None, min_p=0.0
@misc{maiya2025opencharactertrainingshaping,
title={Open Character Training: Shaping the Persona of AI Assistants through Constitutional AI},
author={Sharan Maiya and Henning Bartsch and Nathan Lambert and Evan Hubinger},
year={2025},
eprint={2511.01689},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2511.01689},
}