Views
No views yet
"Look, folks, this adapter, it's about our common purpose, our shared values. That's no joke."
| Feature | Description |
|---|---|
| Base Model | mistralai/Mistral-7B-Instruct-v0.2 |
| Architecture | LoRA adapter (Low-Rank Adaptation) |
| LoRA Rank | 16 |
| Language | English |
| Training Focus | Biden's communication style, rhetoric, and response patterns |
| Merged Adapters | Combines style and identity LoRA weights from: - nnat03/biden-mistral-adapter (original adapter) - ./identity-adapters/biden-identity-adapter |
| 📚 Education | 🔍 Research | 🎭 Creative |
| Political discourse analysis | Rhetoric pattern studies | Interactive simulations |
🧠 Framework: Hugging Face Transformers + PEFT
📊 Optimization: 4-bit quantization
🔧 LoRA Config: r=16, alpha=64, dropout=0.05
🎛️ Target modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj📦 Batch size: 4
🔄 Gradient accumulation: 4
📈 Learning rate: 2e-4
🔁 Epochs: 3
📉 LR scheduler: cosine
⚡ Optimizer: paged_adamw_8bit
🧮 Precision: BF161from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
2from peft import PeftModel
3import torch
4
5# Load base model with 4-bit quantization
6base_model_id = "mistralai/Mistral-7B-Instruct-v0.2"
7bnb_config = BitsAndBytesConfig(
8 load_in_4bit=True,
9 bnb_4bit_compute_dtype=torch.float16,
10 bnb_4bit_quant_type="nf4",
11 bnb_4bit_use_double_quant=True,
12)
13
14# Load model and tokenizer
15model = AutoModelForCausalLM.from_pretrained(
16 base_model_id,
17 quantization_config=bnb_config,
18 device_map="auto",
19 torch_dtype=torch.float16
20)
21tokenizer = AutoTokenizer.from_pretrained(base_model_id)
22
23# Apply the adapter
24model = PeftModel.from_pretrained(model, "nnat03/biden-mistral-adapter")
25
26# Generate a response
27prompt = "What's your vision for America's future?"
28input_text = f"<s>[INST] {prompt} [/INST]"
29inputs = tokenizer(input_text, return_tensors="pt").to("cuda")
30outputs = model.generate(**inputs, max_length=512, temperature=0.7, do_sample=True)
31response = tokenizer.decode(outputs[0], skip_special_tokens=True)
32print(response.split("[/INST]")[-1].strip())1@misc{nnat03-biden-mistral-adapter,
2 author = {nnat03},
3 title = {Biden Mistral Adapter},
4 year = {2023},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/nnat03/biden-mistral-adapter}}
7}