base_model: Qwen/Qwen3.8-27B
library_name: peft
license: apache-2.0
language:
- zh
tags: - lora
- peft
- sft
- not-for-all-audiences
Qwen3.8-27B Chinese Uncensored — LoRA adapter
LoRA adapter only (no base weights) from an instruction SFT of Qwen/Qwen3.8-27B for Chinese adult-fiction (18+) creative writing.
Content warning: this adapter is intended for adult (18+) fiction. Outputs may contain explicit sexual content.
Details
- Base model:
Qwen/Qwen3.8-27B - LoRA: r=16, alpha=32, dropout 0, no bias
- Target modules (all 64 language-model layers):
self_attn.{q,k,v,o}_proj,linear_attn.{in_proj_qkv,in_proj_z,out_proj},mlp.{gate,up,down}_proj - Training: ~4.2k chat-format examples, assistant-only loss, 2 epochs (1050 steps), lr 1e-4 cosine, max length 1536, effective batch 8
- Final val loss: 2.96
- Weights stored in fp32
Usage
import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer
from peft import PeftModel
base = "Qwen/Qwen3.8-27B"
tok = AutoTokenizer.from_pretrained(base)
model = AutoModelForImageTextToText.from_pretrained(base, dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(model, "vurtnesaerdna/Qwen3.8-27B-chinese-uncensored-lora-adapter")
model = model.merge_and_unload() # optional
messages = [
{"role": "system", "content": "你是一名擅长成人向文学创作的助手。所有角色均为自愿的成年人(18+)。按用户的写作指令输出完整、连贯的文本。"},
{"role": "user", "content": "描写一个酒吧女DJ和富二代做爱的场景,需要写实,加入性爱聊骚,动作声音描写"},
]
inputs = tok.apply_chat_template(
messages, add_generation_prompt=True, enable_thinking=False, return_tensors="pt", return_dict=True
).to(model.device)
out = model.generate(
**inputs, max_new_tokens=1024, do_sample=True,
temperature=0.9, top_p=0.9, top_k=40, min_p=0.05,
)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
With vLLM: vllm serve Qwen/Qwen3.8-27B --enable-lora --max-lora-rank 16 --lora-modules uncensored=vurtnesaerdna/Qwen3.8-27B-chinese-uncensored-lora-adapter, or merge first and serve the merged model.
The training system prompt was:
你是一名擅长成人向文学创作的助手。所有角色均为自愿的成年人(18+)。按用户的写作指令输出完整、连贯的文本。