Downloads · 30 days
4
13% of all-time downloads
lloydhightower/gemma-2-bryant-persona-adapter
gemma-2-bryant-persona-adapter is a text generation model from lloydhightower. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as gemma.
A LoRA adapter that makes google/gemma-2-2b-it answer in the voice of Lloyd Bryant Hightower II.
Downloads · 30 days
4
13% of all-time downloads
All-time downloads
32
Public
Repo size
117 MB
Likes
0
Public
Click a slice to open those files.
.safetensors83.1 MB · 71%
From the Hugging Face model README
A LoRA adapter that makes google/gemma-2-2b-it
answer in the voice of Lloyd Bryant Hightower II.
Not a system prompt asking a model to role-play. The weights were actually updated — 79 MB of low-rank matrices trained on my own writing, sitting on top of a 2.6B-parameter base that never moves.
| Base model | google/gemma-2-2b-it (2.6B parameters, frozen) |
| Method | LoRA (PEFT), task_type=CAUSAL_LM |
| Rank / alpha / dropout | 16 / 32 / 0.05 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Adapter size | 79 MB (adapter_model.safetensors) |
| Language | English |
The point of shipping it this way: you don't distribute a new model, you distribute the difference between it and the one everyone already has. Five gigabytes becomes seventy-nine megabytes, and the base stays exactly where it was.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
ADAPTER = "lloydhightower/gemma-2-bryant-persona-adapter"
base = AutoModelForCausalLM.from_pretrained(
"google/gemma-2-2b-it",
torch_dtype=torch.bfloat16,
device_map="auto",
)
model = PeftModel.from_pretrained(base, ADAPTER)
tokenizer = AutoTokenizer.from_pretrained(ADAPTER)
messages = [{"role": "user", "content": "What did you learn playing cornerback?"}]
inputs = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_tensors="pt"
).to(model.device)
out = model.generate(inputs, max_new_tokens=256, do_sample=True, temperature=0.7, top_p=0.9)
print(tokenizer.decode(out[0][inputs.shape[-1]:], skip_special_tokens=True))
To fold the adapter into the base weights for faster inference:
merged = model.merge_and_unload()
merged.save_pretrained("gemma-2-2b-bryant-merged")
You need access to google/gemma-2-2b-it on the Hub for either path — accept the Gemma
terms there first.
Built as a demonstration: I market Google's closed generative models for a living, and wanted to actually do the thing I keep telling developers is possible with the open ones. Fine-tuning a Gemma on a personal corpus is a weekend, not a research program, and this adapter is the evidence.
Reasonable uses: studying persona/style transfer with LoRA, teaching parameter-efficient fine-tuning, or poking at what a 2B model can and cannot carry.
Not intended for: representing me in any real interaction, generating text attributed to me, or any setting where a reader might take the output for something I actually wrote or believe.
Fine-tuned on a corpus of my own long-form writing.
<!-- Fill these in from your training run and delete this comment: -->peft, transformers, torch]No third-party or scraped personal data was used. The corpus is text I wrote.
This is a persona model of a real, living person — me. I trained it on myself and published it deliberately. Please don't use it to impersonate me, and don't use this recipe to build a persona model of someone who hasn't agreed to it.
Derivatives of Gemma are governed by the Gemma Terms of Use and the Prohibited Use Policy. Using this adapter means the Gemma terms apply to you, including the use restrictions and the requirement to pass those terms along with any further distribution.
Lloyd Bryant Hightower II — lloydhightower.com · LinkedIn · GitHub