File size: 10,478 Bytes
ed4212d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b707663
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
---
base_model: Qwen/Qwen3.6-27B
library_name: peft
license: mit
language:
- zh
pipeline_tag: text-generation
tags:
- lora
- peft
- chinese
- folk-horror
- qwen3
- qwen3.6
- text-generation
- creative-writing
---

# 📚 Qwen3.6-27B Chinese Folk Horror LoRA — v2

A LoRA adapter that guides Qwen3.6-27B toward Chinese folk-horror prose (民俗志怪) — a rural supernatural fiction tradition rooted in village life, ancestral memory, and folk belief.

This adapter is designed for a specific writing problem:
Given a short instruction or a neutral scene description, the model should directly produce Chinese folk-horror prose grounded in rural vernacular voice, rather than analysis, outline, summary, or generic supernatural pastiche.

The core direction is intentionally narrow:
- third-person omniscient narration with Free Indirect Discourse (the narrator drifts in and out of characters' inner voice)
- rural village settings: village entrances, ancestral halls, old wells, night roads, lone travelers
- folk-horror imagery grounded in folk belief (阴阳, 邪祟, 招魂, 桃木, 纸钱) rather than Western horror tropes
- regional vernacular diction infused into the narration itself, not just dialogue
- direct fiction prose, not analysis, outlines, or revision advice
- supernatural events treated as a vehicle for depicting human nature and worldly life, not as spectacle

The goal is for outputs to behave more like usable Chinese folk-horror scene drafts in the vernacular tradition, and less like a generic writing assistant explaining what folk-horror is.

Typical use cases:
- drafting folk-horror scenes inside a longer novel project
- rewriting urban-toned paragraphs into rural-vernacular prose
- supernatural village fiction in a long-form writing pipeline
- local and private creative-writing workflows
- integration with a long-form novel pipeline that manages outline, memory, timeline, and continuity

This is an adapter only. It does not include base model weights, training data, or copyrighted source material.

## 🧭 About the v1 / v2 Series

This repository is part of a small series of Chinese fiction LoRAs.

v1 — Style Retraining
The v1 series focuses mainly on prose style. It uses SFT to move the base model away from generic AI prose and toward specific Chinese literary style directions. Different v1 adapters may target different prose voices, such as realistic fiction, literary prose, or other narrative styles.

v2 — Style + Behavioral Fine-Tuning
Adds DPO training, larger amounts of synthetic data, and on-policy sampling on top of the v1 recipe. Output is more precise, more stable, and shows fewer habitual "AI-shaped" patterns.

Available formats: HF PEFT safetensors and GGUF LoRA. MLX users may also be able to use the PEFT safetensors through mlx-lm depending on their local setup.

v2 models are documented in their own repositories.

## 🌱 Status

| Field | Value |
|---|---|
| Version | v2 |
| Focus | Chinese folk-horror prose behavior |
| Format | HF PEFT safetensors + GGUF LoRA |
| Base model | Qwen3.6-27B |
| Language | Chinese |
| Use case | folk-horror scene drafting, rural-vernacular supernatural fiction, FID narration |
| Training style | SFT + manual DPO refinement |
| Recommended workflow | local long-form writing pipeline |

## 🔗 Companion Novel Pipeline

This LoRA is designed to work together with a local-first, long-form Chinese novel writing pipeline:
github.com/DuckTraDo/Novel

The pipeline handles the structural side of long-form fiction:
- outline and chapter planning
- scene-level context assembly
- story memory and character tracking
- timeline and continuity checks

This LoRA handles the prose-behavior side:
- third-person omniscient narration with Free Indirect Discourse
- rural folk-horror scene drafting
- vernacular diction grounded in regional rural Chinese voice
- anti-modern-urban-tone and anti-Western-horror-trope

They are intentionally split: the pipeline owns what happens, the LoRA owns how it reads on the page. You can use either independently, but they are designed as a pair.

## 📦 Files

Files included: `adapter_config.json`, `adapter_model.safetensors`, `qwen3-6-27b-chinese-folk-horror-lora-v2-f16.gguf`, `tokenizer.json`, `tokenizer_config.json`, `chat_template.jinja`, `README.md`.

## ⚠️ Critical Usage Note: enable_thinking=False

Qwen3.6 base model ships with a thinking mode enabled by default. When using `apply_chat_template(messages, add_generation_prompt=True)` with default settings, the chat template leaves an unclosed `<think>\n` block before the assistant's turn. With this LoRA loaded, this causes outputs to begin with English thinking-process preamble (e.g. "Here's a thinking process: 1. Analyze User Input...") instead of Chinese fiction prose.

The training samples used a closed empty thinking block: `<think>\n\n</think>\n\nactual prose...`

Always pass `enable_thinking=False`:

```python
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)
```

For llama.cpp / GGUF inference, the included `chat_template.jinja` file should be passed via `--chat-template-file`, or the assistant prefix `<think>\n\n</think>\n\n` should be manually prepended in the prompt.

This is the single most common usage error. If outputs look like English reasoning instead of Chinese prose, this is almost certainly the cause.

## 🚀 Example PEFT / Transformers Usage

```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base_model, adapter = "Qwen/Qwen3.6-27B", "yuxinlu1/qwen3-6-27b-chinese-folk-horror-lora-v2"

tokenizer = AutoTokenizer.from_pretrained(adapter, trust_remote_code=True)

base = AutoModelForCausalLM.from_pretrained(base_model, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True)
model = PeftModel.from_pretrained(base, adapter).eval()

messages = [{"role": "user", "content": "写一段乡村怪谈,村口那棵老槐树有些年头了。"}]

text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True,
    enable_thinking=False,
)

inputs = tokenizer(text, return_tensors="pt").to(model.device)

output = model.generate(**inputs, max_new_tokens=900, temperature=0.8, top_p=0.9, do_sample=True, pad_token_id=tokenizer.eos_token_id)
print(tokenizer.decode(output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
```

## 🚀 Example llama.cpp Usage

Pair this GGUF LoRA with a compatible Qwen3.6-27B GGUF base. Unsloth Qwen3.6-27B-GGUF (`Q4_K_M` or `Q8_0`) is recommended.

```bash
llama-cli -m qwen3.6-27b-base.Q4_K_M.gguf --lora qwen3-6-27b-chinese-folk-horror-lora-v2-f16.gguf --chat-template-file chat_template.jinja -p "写一段乡村怪谈,村口那棵老槐树有些年头了。" -n 900 --temp 0.8 --top-p 0.9 --repeat-penalty 1.05
```

## 🧪 Example Prompts

Prompts can be short:

Example prompts:

```text
写一段民俗志怪小说。
讲一个乡村怪谈。
村口那棵老槐树,听老人说有些年头了。
小说:祠堂深夜,几个老人围坐抽烟。
把下面这段改成民俗志怪小说正文:
村里的张阿婆最近总说半夜听到隔壁屋有人叫她的名字,可她一个人住,屋外只有那棵老桑树。
```

Suggested decoding range:

| Setting | Range |
|---|---|
| temperature | 0.7–0.85 |
| top_p | 0.85–0.95 |
| max_new_tokens | 600–1200 |

## 🧪 Internal Evaluation Snapshot

A small internal evaluation was run across four prompt tiers (original-text continuation, neutral scene description, character-grounded task, and minimal generic instruction) to verify style transfer.

Qualitative observations:
- Original-text continuation: natural prose continuation in the trained voice; rural vernacular and FID narration carry through.
- Neutral scene description: supernatural and atmospheric elements emerge from neutral prompts without explicit folk-horror cues in the input.
- Character-grounded task: characters behave consistently with rural folk-horror conventions.
- Minimal generic instruction (e.g. "write a piece of folk-horror fiction"): the model produces folk-horror prose directly without first explaining what folk-horror is — confirming that style was internalized, not merely instruction-followed.

These observations come from a small local development eval and should be treated as an internal signal, not a public benchmark.

## 🧪 Intended Use

Intended for:
- local Chinese folk-horror drafting
- rewriting urban-toned paragraphs into rural-vernacular folk-horror prose
- testing third-person omniscient FID narration
- supernatural village fiction in a human-in-the-loop workflow
- offline and privacy-respecting novel drafting
- integration with a long-form novel pipeline

Not intended for: author impersonation, defamation, harassment, factual claims, high-stakes advice, spam, or deception.

## ⚠️ Limitations

- It does not guarantee full-novel plot coherence by itself.
- Character continuity, foreshadowing, and timeline logic should be handled by an external writing pipeline or by the author.
- Output may occasionally tilt toward dialogue-heavy passages when scene prompts are very abstract.
- Optimized for rural village settings; outputs for urban supernatural or modern occult scenes may revert toward base model tone.
- It may produce shorter-than-expected outputs if the prompt is very minimal or decoding settings are conservative.
- If `enable_thinking=False` is not set, outputs will begin with English thinking-process preamble. This is the single most common usage error.
- Output quality depends on the base model, quantization, sampling settings, prompt design, and context quality.

## 🛡️ Safety and Legal Notes

- This repository contains adapter weights and supporting tokenizer/template files, not base model weights.
- No copyrighted novels, private manuscripts, or proprietary datasets are distributed in this repository.
- This LoRA is not designed to imitate any specific living author; the goal is to capture a broader regional vernacular folk-horror tradition rooted in northern rural Chinese cultural settings.
- Outputs are machine-generated fiction; do not use this model for harassment, defamation, fraud, or deceptive impersonation.
- Users are responsible for the base model license, adapter license, and applicable law.

## 📜 License

LoRA adapter: MIT. Base model: governed by its own license.