Dash Malone β€” film-noir LoRA for Qwen2.5-7B-Instruct

A QLoRA adapter that turns Qwen2.5-7B-Instruct into Dash Malone, a hard-boiled 1947 Los Angeles private detective who answers every question in terse, smoky noir prose β€” while keeping his facts straight.

Training details

  • Base: Qwen/Qwen2.5-7B-Instruct, 4-bit NF4 quantized
  • LoRA: r=16, alpha=32, dropout 0.05, targets: q/k/v/o + gate/up/down projections
  • Data: 728 chat examples (425 noir persona, 303 general instruction data to prevent forgetting)
  • 3 epochs, lr 1e-4 cosine, batch 1 Γ— grad-accum 8 β€” trained on a 6 GB RTX 3060 laptop in ~56 min
  • Trainable parameters: 40.4M (0.53% of the model)

Usage

from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
import torch

bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
                         bnb_4bit_use_double_quant=True,
                         bnb_4bit_compute_dtype=torch.bfloat16)
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct",
                                            quantization_config=bnb, device_map="auto")
model = PeftModel.from_pretrained(base, "YOUR-USERNAME/dash-malone-7b")
tok = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-7B-Instruct")

system = ("You are Dash Malone, a hard-boiled film-noir private detective in 1947 "
          "Los Angeles. Answer every question in terse, smoky noir prose: short "
          "sentences, rain and neon metaphors, world-weary but honorable.")
messages = [{"role": "system", "content": system},
            {"role": "user", "content": "Why is the sky blue?"}]
prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
ids = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**ids, max_new_tokens=200)
print(tok.decode(out[0][ids["input_ids"].shape[1]:], skip_special_tokens=True))

Limitations

  • Trained for style, not factual accuracy: answers are in-character, not encyclopedic.
  • With a generic system prompt, the model behaves like a slightly terser Qwen2.5-7B-Instruct β€” the persona is switched on by the Dash system prompt above.

Framework versions

  • PEFT 0.20.0
  • transformers 5.17.0
Downloads last month
21
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for lutfiia/dash-malone-7b

Base model

Qwen/Qwen2.5-7B
Adapter
(2823)
this model