Instructions to use lutfiia/dash-malone-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use lutfiia/dash-malone-7b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct") model = PeftModel.from_pretrained(base_model, "lutfiia/dash-malone-7b") - Transformers
How to use lutfiia/dash-malone-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lutfiia/dash-malone-7b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("lutfiia/dash-malone-7b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lutfiia/dash-malone-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lutfiia/dash-malone-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lutfiia/dash-malone-7b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lutfiia/dash-malone-7b
- SGLang
How to use lutfiia/dash-malone-7b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "lutfiia/dash-malone-7b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lutfiia/dash-malone-7b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "lutfiia/dash-malone-7b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lutfiia/dash-malone-7b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use lutfiia/dash-malone-7b with Docker Model Runner:
docker model run hf.co/lutfiia/dash-malone-7b
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