初始化项目,由ModelHub XC社区提供模型

Model: Fordentinc/book-builder-bookwriter-v1
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-08-05 12:49:18 +08:00
commit 078bb5f6b6
35 changed files with 152939 additions and 0 deletions

40
.gitattributes vendored Normal file
View File

@@ -0,0 +1,40 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
tokenizer.json filter=lfs diff=lfs merge=lfs -text
book-builder-bookwriter-v1-F16.gguf filter=lfs diff=lfs merge=lfs -text
book-builder-bookwriter-v1-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
book-builder-bookwriter-v1-Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
book-builder-bookwriter-v1-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text

15
Modelfile Normal file
View File

@@ -0,0 +1,15 @@
# Ollama Modelfile for book-builder-bookwriter-v1
# This is a base completion model — no chat template.
# Use Ollama in raw-prompt mode:
# ollama run hf.co/Fordentinc/book-builder-bookwriter-v1:Q5_K_M --raw < your_bible.txt
FROM hf.co/Fordentinc/book-builder-bookwriter-v1:Q5_K_M
TEMPLATE """{{ .Prompt }}"""
PARAMETER temperature 0.8
PARAMETER top_p 0.95
PARAMETER repeat_penalty 1.05
PARAMETER num_ctx 8192
PARAMETER num_predict 2048
# No stop tokens — let the model write a full chapter.

234
README.md Normal file
View File

@@ -0,0 +1,234 @@
---
license: apache-2.0
language:
- en
tags:
- prose
- novel-writing
- bookbuilder
- creative-writing
- qlora
- qwen2.5
- wip
- beta
- early-release
base_model: Qwen/Qwen2.5-7B
pipeline_tag: text-generation
extra_gated_description: "This is an early-release v1 model with known limitations. A larger v2 is in development. Please read the Work in Progress section before use."
---
# 🚧 WORK IN PROGRESS — v1 EARLY RELEASE 🚧
# A bigger, better model (v2) is in development.
This page is the v1 early release of `book-builder-bookwriter-v1`. It is **not the final model**. Skim the rest of this card before you generate anything so you know what you're getting and what you're not.
---
# book-builder-bookwriter-v1
A 7.6B-parameter prose-writing model fine-tuned on 10,211 human-authored novels (310,316 chapters, ~1.82 billion tokens) with a strict story-bible-to-chapter format. Built for [BookBuilder](https://book-builder.net) to generate novel chapters from structured story bibles.
> ## ⚠ Work in Progress (v1, early release)
>
> This is an **early checkpoint** of an ongoing training run. Training was paused at step 5000 / 9697 (~52% of one epoch) so the artifacts could be released publicly while the larger run continues.
>
> **Known limitations of v1:**
> - Treats bibles as style prompts, not strict plot instructions. Expect drift from the synopsis on one-shot generation.
> - Does not reliably follow "FORBIDDEN" rules, character role assignments, or per-character constraints in rich BookBuilder-style bibles.
> - Loaded keywords in synopses (proper names like "Stillwater", specific years like "1947") can trigger off-topic associations from the training corpus.
> - On longer generations, may drift into paragraph-level repetition loops without the tuned sampling defaults in `ollama/Modelfile`.
>
> **What's coming:**
> - **v2 (Q3/Q4 2026):** Larger base model (Qwen 2.5 14B or 32B) + synthesized instruction-following data so the model can actually obey FORBIDDEN sections, distinguish protagonists from antagonists, and follow beat sheets. This addresses the main v1 limitation.
> - **v1 continuation to step 9697:** the LoRA may be taken to the full single-epoch checkpoint and re-released as `book-builder-bookwriter-v1.1` if testing shows it's worth the additional training compute. The resumable training state is preserved at branch [`resumable-step-5000`](https://huggingface.co/Fordentinc/book-builder-bookwriter-v1/tree/resumable-step-5000).
>
> **Best use for v1 right now:** as a prose-style backbone inside a structured pipeline (like BookBuilder itself) that provides per-chapter beat sheets and plot anchors at generation time. The pipeline supplies the discipline the v1 model can't enforce on its own. For one-shot "give me a chapter from a synopsis" use, v1 produces readable prose but will frequently drift from the intended plot.
**This is NOT a chat model. Do not prompt it like ChatGPT. See "How to use" below.**
## What this model does
You write a **Story Bible** in the format shown below (or fill in the [template](./bible_template.txt)).
You give the model the bible plus `### Chapter`.
The model writes the chapter prose.
It will not answer questions. It will not respond to "Write me a story about X." It only continues prose conditioned on the bible context.
## Format the model expects
Every training example looked exactly like this:
```
### Bible
Title: [book title]
Author: [author name]
Genre: [genre]
Publisher: [publisher]
Synopsis: [1-3 paragraphs describing the book]
### Genre
[genre]
### Chapter
[chapter title]
[chapter prose...]
```
Your prompt MUST end at `### Chapter\n[chapter title]\n\n` and the model fills in the prose.
## How to use
### Option 1: Ollama (easiest)
**IMPORTANT:** A plain `ollama pull` from HF discards any Modelfile parameters in the repo, so Ollama runs the model with its default sampling — which on long completion prompts causes repetition loops and over-long generations. **Use the setup script below** to register the model under the name `bookbuilder` with tuned defaults that prevent both problems.
**One-shot setup:**
```bash
curl -sSL https://huggingface.co/Fordentinc/book-builder-bookwriter-v1/resolve/main/ollama/setup_ollama.sh | bash
# Optional: pass a quant tag, default is Q5_K_M
# curl -sSL https://huggingface.co/Fordentinc/book-builder-bookwriter-v1/resolve/main/ollama/setup_ollama.sh | bash -s Q8_0
```
Then:
```bash
ollama run bookbuilder < your_bible.txt
```
The script pulls the GGUF, builds a local `Modelfile` with the right `repeat_penalty 1.18`, `num_predict 2500`, and stop tokens, and registers the result as `bookbuilder`.
**If you'd rather pull manually** (without the loop fix), you need to pass sampling flags every time:
```bash
ollama pull hf.co/Fordentinc/book-builder-bookwriter-v1:Q5_K_M
ollama run hf.co/Fordentinc/book-builder-bookwriter-v1:Q5_K_M \
--num-predict 2500 --repeat-penalty 1.18 --temperature 0.75
```
Available quants:
- `Q4_K_M` (4.7 GB) - fits on 8 GB GPUs, some token-decoding artifacts
- `Q5_K_M` (5.4 GB) - balanced, **recommended** for 24 GB cards
- `Q8_0` (8.1 GB) - near-lossless, cleaner token decoding than K-quants
- `F16` (15.2 GB) - full precision, no quantization artifacts
### Option 2: LM Studio
1. Search for `Fordentinc/book-builder-bookwriter-v1`
2. Download the Q5_K_M quant
3. Switch to **Completion mode** (not Chat). This is critical.
4. Paste your filled-in bible as the input
5. Generate
### Option 3: llama.cpp
```bash
./llama-cli -hf Fordentinc/book-builder-bookwriter-v1:Q5_K_M \
--temp 0.8 --top-p 0.95 -n 2048 \
-f your_bible.txt
```
### Option 4: Transformers + PEFT (Python, full bf16)
```python
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base_id = "Qwen/Qwen2.5-7B"
adapter = "Fordentinc/book-builder-bookwriter-v1"
tok = AutoTokenizer.from_pretrained(adapter)
base = AutoModelForCausalLM.from_pretrained(base_id, torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(base, adapter)
model.eval()
bible_and_chapter_header = open("your_bible.txt").read()
inputs = tok(bible_and_chapter_header, return_tensors="pt").to("cuda")
out = model.generate(
**inputs,
max_new_tokens=2048,
do_sample=True, temperature=0.8, top_p=0.95,
repetition_penalty=1.05,
)
print(tok.decode(out[0], skip_special_tokens=True))
```
### Option 5: vLLM (production / OpenAI-compatible API)
vLLM cannot load the LoRA adapter alone; use the merged bf16 weights instead:
```bash
vllm serve Fordentinc/book-builder-bookwriter-v1 --dtype bfloat16 --max-model-len 16384
```
## Step-by-step: from blank page to chapter
1. **Download the template:** [bible_template.txt](./bible_template.txt)
2. **Fill in every field.** The model relies on each section to anchor character voices, setting, and tone.
3. **Save as plain text** (e.g. `my_book.txt`).
4. **End the file with `### Chapter` followed by your chapter title and one blank line.** Example:
```
### Chapter
Chapter 1: The Long Drive Home
```
5. **Run inference** using one of the options above.
6. **The model writes ~1500-4000 words** of prose, then stops or hits your `max_new_tokens` cap.
7. **For chapter 2:** keep the same bible, change the chapter header, optionally append the last paragraph of chapter 1 so the model continues smoothly.
See [example_bibles/](./example_bibles/) for two complete working examples.
## Recommended sampling parameters
| Parameter | Value | Why |
|---|---|---|
| `temperature` | 0.8 | Lower = repetitive, higher = incoherent |
| `top_p` | 0.95 | Standard nucleus sampling |
| `repetition_penalty` | 1.05 | Prevents loops; do not push past 1.15 |
| `max_new_tokens` | 2048-4096 | Most chapters land in 1500-3500 tokens |
| `min_p` | 0.05 (if supported) | Better than top_k for prose |
## Training details
- **Base model:** Qwen 2.5 7B (Apache 2.0)
- **Method:** QLoRA, r=16, alpha=32, dropout 0.05
- **Target modules:** q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
- **Training corpus:** 10,211 novels with derivable story bibles (Sci-Fi, Thriller, Romance, Crime, Western, Fantasy, etc.)
- **Corpus stats:** 310,316 chapter rows, ~1.4 billion words, ~1.82 billion tokens
- **Hardware:** 1× NVIDIA B200 (180 GB HBM3e)
- **Sequence length:** 2048
- **Effective batch:** 32 (per-device 4, grad-accum 8)
- **Optimizer:** paged_adamw_8bit
- **LR:** 2e-4 cosine, 3% warmup
- **Epochs:** 1
- **Wall time:** ~13.5 hours
- **Data cleanup:** em-dashes removed (replaced with commas), smart-quotes normalized, residual front-matter stripped, chapters with <800 or >6000 words filtered out
## Quirks and limitations
- **No system messages, no chat history, no `[INST]` tags.** The model was never shown those during training.
- **Bibles outside its training distribution** (highly experimental forms, non-Western names, modern slang heavy) may produce uneven results.
- **Names follow Western conventions** (USA/UK/Italy/Western Europe). The training filter excluded other naming traditions.
- **Em-dashes are absent from training data** and the model will rarely produce them. This is intentional.
- **Chapter length is learned from data** (avg ~4,500 words). To force shorter chapters, cap `max_new_tokens`.
## License
Apache 2.0 (inherited from base Qwen 2.5 7B). You may use commercially.
## Citation
```bibtex
@misc{bookbuilder_bookwriter_v1_2026,
author = {Fordentinc},
title = {book-builder-bookwriter-v1: A prose-writing LoRA on Qwen 2.5 7B},
year = {2026},
url = {https://huggingface.co/Fordentinc/book-builder-bookwriter-v1},
}
```
## Reporting issues
Open a discussion on this model page. Include the bible you used (first 500 chars) and the first 200 chars of the model output.

34
adapter_config.json Normal file
View File

@@ -0,0 +1,34 @@
{
"alpha_pattern": {},
"auto_mapping": null,
"base_model_name_or_path": "Qwen/Qwen2.5-7B",
"bias": "none",
"fan_in_fan_out": false,
"inference_mode": true,
"init_lora_weights": true,
"layer_replication": null,
"layers_pattern": null,
"layers_to_transform": null,
"loftq_config": {},
"lora_alpha": 32,
"lora_dropout": 0.05,
"megatron_config": null,
"megatron_core": "megatron.core",
"modules_to_save": null,
"peft_type": "LORA",
"r": 16,
"rank_pattern": {},
"revision": null,
"target_modules": [
"up_proj",
"v_proj",
"q_proj",
"gate_proj",
"k_proj",
"down_proj",
"o_proj"
],
"task_type": "CAUSAL_LM",
"use_dora": false,
"use_rslora": false
}

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d9d36ec0c5009a8e99439df21e89a38a72199a3f70bdf0f330f02ed29bc2257b
size 161533192

24
added_tokens.json Normal file
View File

@@ -0,0 +1,24 @@
{
"</tool_call>": 151658,
"<tool_call>": 151657,
"<|box_end|>": 151649,
"<|box_start|>": 151648,
"<|endoftext|>": 151643,
"<|file_sep|>": 151664,
"<|fim_middle|>": 151660,
"<|fim_pad|>": 151662,
"<|fim_prefix|>": 151659,
"<|fim_suffix|>": 151661,
"<|im_end|>": 151645,
"<|im_start|>": 151644,
"<|image_pad|>": 151655,
"<|object_ref_end|>": 151647,
"<|object_ref_start|>": 151646,
"<|quad_end|>": 151651,
"<|quad_start|>": 151650,
"<|repo_name|>": 151663,
"<|video_pad|>": 151656,
"<|vision_end|>": 151653,
"<|vision_pad|>": 151654,
"<|vision_start|>": 151652
}

15
bible_template.txt Normal file
View File

@@ -0,0 +1,15 @@
### Bible
Title: [YOUR BOOK TITLE — required, e.g. "The Long Drive Home"]
Author: [PEN NAME — required, e.g. "Eleanor Whitford"]
Genre: [PICK ONE — Romance, Thriller/Crime, Mystery, Western, Sci-Fi, Fantasy, Historical, Biblical, Literary, etc.]
Publisher: [IMPRINT NAME — can be made up, e.g. "Hawthorne House"]
Synopsis: [WRITE 2-4 SENTENCES describing the central conflict, the protagonist's stakes, and the world's flavor. The model uses this to anchor voice and pacing. Be concrete — name characters and places. Avoid abstractions like "a journey of self-discovery." Show what HAPPENS.]
### Genre
[REPEAT YOUR GENRE — same as the one above]
### Chapter
[YOUR CHAPTER HEADING — e.g. "Chapter 1: The Long Drive Home" or just "1"]

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:99317adb258249f9882a9b5e673642ce1ab01b1d55b846e0c911af9a220af279
size 15237852992

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e129acd8ea20260c72c6a5f5ee77456971737fcbb6df2f930213e562d530f3cc
size 4683073344

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:023a31216a2948c0418c55b55a6bdf92b759828971c3311b522cf9ced80edf55
size 5444831040

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:06657ca1461c2dd0b80aba911dcbf147c55bc17caca4642ab6c69000e57295a6
size 8098524992

30
config.json Normal file
View File

@@ -0,0 +1,30 @@
{
"_name_or_path": "Qwen/Qwen2.5-7B",
"architectures": [
"Qwen2ForCausalLM"
],
"attention_dropout": 0.0,
"bos_token_id": 151643,
"eos_token_id": 151643,
"hidden_act": "silu",
"hidden_size": 3584,
"initializer_range": 0.02,
"intermediate_size": 18944,
"max_position_embeddings": 131072,
"max_window_layers": 28,
"model_type": "qwen2",
"num_attention_heads": 28,
"num_hidden_layers": 28,
"num_key_value_heads": 4,
"rms_norm_eps": 1e-06,
"rope_scaling": null,
"rope_theta": 1000000.0,
"sliding_window": null,
"tie_word_embeddings": false,
"torch_dtype": "bfloat16",
"transformers_version": "4.46.3",
"use_cache": true,
"use_mrope": false,
"use_sliding_window": false,
"vocab_size": 152064
}

View File

@@ -0,0 +1,15 @@
### Bible
Title: The Long Drive Home
Author: Eleanor Whitford
Genre: Western
Publisher: Hawthorne House
Synopsis: After twenty years of running the Box Star ranch in the Texas panhandle, Cyrus Brennan loses his wife Mary to a fever in the autumn of 1881. Months later he agrees, against his better judgment, to lead one last cattle drive north to the Kansas railheads, six hundred miles through dust, river crossings, and Comanche country. With him rides his estranged son Daniel, a young hand named Whit who keeps too quiet a counsel, and a Mexican vaquero named Tomás who knows the Cimarron crossings better than any man living. Before they reach Dodge City, Cyrus must reckon with a debt he owes a banker in Fort Worth, a rustler band riding the Brazos, and the slow truth that the country he helped settle no longer has any use for the man he became.
### Genre
Western
### Chapter
Chapter 1: A Letter from Fort Worth

View File

@@ -0,0 +1,15 @@
### Bible
Title: The Wisteria House
Author: Margaret Holloway
Genre: Romance
Publisher: Linden Press
Synopsis: Claire Bennett returns to Savannah after a decade in Boston to settle her late grandmother's estate, a crumbling antebellum house on Habersham Street with a wisteria-choked garden and a roof that leaks every August. She intends to sell it and be back in her Brookline apartment by Labor Day. She did not intend to find Sam Whitlock living in the carriage house, the same Sam who left town the summer they were both eighteen without a word and never came back. Now he runs a struggling furniture restoration shop, drives a green pickup, and looks at her in a way that suggests the past did not happen the way she remembers it. Over a long, slow Georgia summer Claire must decide what to do with the house, with the truth her grandmother kept from both of them, and with the man she spent ten years trying not to think about.
### Genre
Romance
### Chapter
Chapter 1: Habersham Street, June

6
generation_config.json Normal file
View File

@@ -0,0 +1,6 @@
{
"bos_token_id": 151643,
"eos_token_id": 151643,
"max_new_tokens": 2048,
"transformers_version": "4.46.3"
}

56
inference_example.py Normal file
View File

@@ -0,0 +1,56 @@
#!/usr/bin/env python3
"""
Minimum-viable inference example for Fordentinc/book-builder-bookwriter-v1.
Loads Qwen 2.5 7B base + the LoRA adapter, reads a bible file from disk,
generates a chapter, writes it to stdout.
Usage:
pip install torch transformers peft accelerate
python inference_example.py path/to/your_bible.txt
"""
import sys, torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
BASE = "Qwen/Qwen2.5-7B"
ADAPTER = "Fordentinc/book-builder-bookwriter-v1"
def main():
if len(sys.argv) < 2:
print("usage: python inference_example.py <bible.txt>", file=sys.stderr)
sys.exit(1)
prompt = open(sys.argv[1]).read()
if "### Chapter" not in prompt:
print("ERROR: bible must end with '### Chapter\\n<title>\\n\\n'", file=sys.stderr)
sys.exit(2)
print(f"Loading base: {BASE}", file=sys.stderr)
tok = AutoTokenizer.from_pretrained(ADAPTER)
base = AutoModelForCausalLM.from_pretrained(
BASE, torch_dtype=torch.bfloat16, device_map="auto",
)
print(f"Loading adapter: {ADAPTER}", file=sys.stderr)
model = PeftModel.from_pretrained(base, ADAPTER)
model.eval()
print(f"Prompt length: {len(prompt)} chars", file=sys.stderr)
inputs = tok(prompt, return_tensors="pt").to(model.device)
with torch.inference_mode():
out = model.generate(
**inputs,
max_new_tokens=2048,
do_sample=True,
temperature=0.8,
top_p=0.95,
repetition_penalty=1.05,
pad_token_id=tok.eos_token_id,
)
full = tok.decode(out[0], skip_special_tokens=True)
# Print only the generated continuation (strip the bible)
print(full[len(prompt):])
if __name__ == "__main__":
main()

151388
merges.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:dc3b67e2d54152fe72f25bb1df4c6d46bb50a45097cdec9ad42240dbd23852d2
size 4877660776

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3350b130b4bbaa67af4c067189cb1b8cf0246ceeb61a8634f75e798b5e68e6d9
size 4932751008

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7c1b9eb41bc750194301475aa08e7ef0937e8dcfe291f6049105d1cf248097ed
size 4330865200

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5be8567a86b9f8fdf251358a5757baf1e45239e4ba2ed2bb04d81d824a7031c5
size 1089994880

View File

@@ -0,0 +1,346 @@
{
"metadata": {
"total_size": 15231233024
},
"weight_map": {
"lm_head.weight": "model-00004-of-00004.safetensors",
"model.embed_tokens.weight": "model-00001-of-00004.safetensors",
"model.layers.0.input_layernorm.weight": "model-00001-of-00004.safetensors",
"model.layers.0.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.0.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.0.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.0.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
"model.layers.0.self_attn.k_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.0.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.0.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.0.self_attn.q_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.0.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.0.self_attn.v_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.0.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.1.input_layernorm.weight": "model-00001-of-00004.safetensors",
"model.layers.1.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.1.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.1.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.1.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
"model.layers.1.self_attn.k_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.1.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.1.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.1.self_attn.q_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.1.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.1.self_attn.v_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.1.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.10.input_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.10.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.10.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.10.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.10.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.10.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.10.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.10.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.10.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.10.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.10.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.10.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.11.input_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.11.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.11.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.11.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.11.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.11.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.11.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.11.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.11.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.11.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.11.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.11.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.12.input_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.12.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.12.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.12.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.12.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.12.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.12.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.12.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.12.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.12.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.12.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.12.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.13.input_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.13.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.13.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.13.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.13.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.13.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.13.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.13.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.13.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.13.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.13.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.13.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.14.input_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.14.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.14.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.14.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.14.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.14.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.14.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.14.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.14.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.14.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.14.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.14.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.15.input_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.15.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.15.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.15.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.15.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.15.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.15.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.15.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.15.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.15.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.15.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.15.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.16.input_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.16.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.16.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.16.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.16.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.16.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.16.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.16.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.16.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.16.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.16.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.16.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.17.input_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.17.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.17.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.17.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.17.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.17.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.17.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.17.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.17.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.17.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.17.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.17.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.18.input_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.18.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.18.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.18.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.18.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.18.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.18.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.18.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.18.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.18.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.18.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.18.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.19.input_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.19.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.19.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.19.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.19.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.19.self_attn.k_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.19.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.19.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.19.self_attn.q_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.19.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.19.self_attn.v_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.19.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.2.input_layernorm.weight": "model-00001-of-00004.safetensors",
"model.layers.2.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.2.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.2.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.2.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
"model.layers.2.self_attn.k_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.2.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.2.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.2.self_attn.q_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.2.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.2.self_attn.v_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.2.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.20.input_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.20.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.20.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.20.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.20.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.20.self_attn.k_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.20.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.20.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.20.self_attn.q_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.20.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.20.self_attn.v_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.20.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.21.input_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.21.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.21.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.21.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.21.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.21.self_attn.k_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.21.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.21.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.21.self_attn.q_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.21.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.21.self_attn.v_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.21.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.22.input_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.22.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.22.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.22.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.22.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.22.self_attn.k_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.22.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.22.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.22.self_attn.q_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.22.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.22.self_attn.v_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.22.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.23.input_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.23.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.23.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.23.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.23.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.23.self_attn.k_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.23.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.23.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.23.self_attn.q_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.23.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.23.self_attn.v_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.23.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.24.input_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.24.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.24.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.24.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.24.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.24.self_attn.k_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.24.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.24.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.24.self_attn.q_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.24.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.24.self_attn.v_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.24.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.25.input_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.25.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.25.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.25.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.25.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.25.self_attn.k_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.25.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.25.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.25.self_attn.q_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.25.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.25.self_attn.v_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.25.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.26.input_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.26.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.26.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.26.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.26.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.26.self_attn.k_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.26.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.26.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.26.self_attn.q_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.26.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.26.self_attn.v_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.26.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.27.input_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.27.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.27.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.27.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.27.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
"model.layers.27.self_attn.k_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.27.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.27.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.27.self_attn.q_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.27.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.27.self_attn.v_proj.bias": "model-00003-of-00004.safetensors",
"model.layers.27.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
"model.layers.3.input_layernorm.weight": "model-00001-of-00004.safetensors",
"model.layers.3.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.3.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.3.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.3.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
"model.layers.3.self_attn.k_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.3.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.3.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.3.self_attn.q_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.3.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.3.self_attn.v_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.3.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.4.input_layernorm.weight": "model-00001-of-00004.safetensors",
"model.layers.4.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.4.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.4.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.4.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
"model.layers.4.self_attn.k_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.4.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.4.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.4.self_attn.q_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.4.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.4.self_attn.v_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.4.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.5.input_layernorm.weight": "model-00001-of-00004.safetensors",
"model.layers.5.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.5.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.5.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.5.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
"model.layers.5.self_attn.k_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.5.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.5.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.5.self_attn.q_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.5.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.5.self_attn.v_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.5.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.6.input_layernorm.weight": "model-00001-of-00004.safetensors",
"model.layers.6.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.6.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.6.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.6.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
"model.layers.6.self_attn.k_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.6.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.6.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.6.self_attn.q_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.6.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.6.self_attn.v_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.6.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.7.input_layernorm.weight": "model-00001-of-00004.safetensors",
"model.layers.7.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.7.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.7.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.7.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
"model.layers.7.self_attn.k_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.7.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.7.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.7.self_attn.q_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.7.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.7.self_attn.v_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.7.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.8.input_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.8.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.8.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.8.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.8.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.8.self_attn.k_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.8.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.8.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.8.self_attn.q_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.8.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.8.self_attn.v_proj.bias": "model-00001-of-00004.safetensors",
"model.layers.8.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
"model.layers.9.input_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.9.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.9.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.9.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.9.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
"model.layers.9.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.9.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.9.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.9.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.9.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
"model.layers.9.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
"model.layers.9.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
"model.norm.weight": "model-00003-of-00004.safetensors"
}
}

34
ollama/Modelfile Normal file
View File

@@ -0,0 +1,34 @@
# Modelfile for book-builder-bookwriter-v1.
# Defaults tuned to prevent both repetition loops AND synonym-chain runaway.
#
# Use with:
# ollama pull hf.co/Fordentinc/book-builder-bookwriter-v1:F16
# ollama create bookbuilder -f Modelfile
# ollama run bookbuilder < your_bible.txt
#
# Change FROM to :Q8_0 or :Q5_K_M for smaller / faster, but F16 has the
# cleanest token decoding.
FROM hf.co/Fordentinc/book-builder-bookwriter-v1:F16
# Raw completion - no chat wrap.
TEMPLATE """{{ .Prompt }}"""
SYSTEM ""
# Sampling
PARAMETER temperature 0.8
PARAMETER top_p 0.92
PARAMETER top_k 40
PARAMETER min_p 0.05
PARAMETER repeat_penalty 1.08
PARAMETER repeat_last_n 128
# Length and context
PARAMETER num_ctx 8192
PARAMETER num_predict 2500
# Stop before the model invents a Chapter 2 or restarts the bible
PARAMETER stop "### Chapter"
PARAMETER stop "Chapter 2:"
PARAMETER stop "### Bible"
PARAMETER stop "### Genre"

63
ollama/setup_ollama.sh Normal file
View File

@@ -0,0 +1,63 @@
#!/usr/bin/env bash
# One-shot setup: pull the requested GGUF and register it locally as `bookbuilder`
# with sampling defaults tuned to prevent both repetition loops and synonym-chain
# runaway.
#
# Run: bash setup_ollama.sh [quant]
# Optional [quant]: Q4_K_M | Q5_K_M | Q8_0 | F16 (default F16 — cleanest decoding)
set -euo pipefail
QUANT="${1:-F16}"
REPO="hf.co/Fordentinc/book-builder-bookwriter-v1"
LOCAL_NAME="bookbuilder"
echo "==> Pulling $REPO:$QUANT (this may take several minutes; F16 is ~15 GB)"
ollama pull "$REPO:$QUANT"
TMPDIR="$(mktemp -d)"
cat > "$TMPDIR/Modelfile" <<EOF
FROM $REPO:$QUANT
TEMPLATE """{{ .Prompt }}"""
SYSTEM ""
PARAMETER temperature 0.8
PARAMETER top_p 0.92
PARAMETER top_k 40
PARAMETER min_p 0.05
PARAMETER repeat_penalty 1.08
PARAMETER repeat_last_n 128
PARAMETER num_ctx 8192
PARAMETER num_predict 2500
PARAMETER stop "### Chapter"
PARAMETER stop "Chapter 2:"
PARAMETER stop "### Bible"
PARAMETER stop "### Genre"
EOF
echo "==> Registering local model 'bookbuilder' from $REPO:$QUANT"
ollama create "$LOCAL_NAME" -f "$TMPDIR/Modelfile"
rm -rf "$TMPDIR"
echo ""
echo "==> Done. Now run:"
echo " ollama run bookbuilder < your_bible.txt"
echo ""
echo "Format reminder for your_bible.txt — every line must be left-justified, no leading spaces:"
echo " ### Bible"
echo " Title: ..."
echo " Author: ..."
echo " Genre: ..."
echo " Publisher: ..."
echo " Synopsis: ..."
echo " [blank line]"
echo " ### Genre"
echo " [genre]"
echo " [blank line]"
echo " [blank line]"
echo " [blank line]"
echo " ### Chapter"
echo " Chapter 1: <title>"
echo " [blank line]"
echo ""
echo "Bibles with leading whitespace WILL produce off-topic generations."

111
resume/RESUME.md Normal file
View File

@@ -0,0 +1,111 @@
# How to resume training from step 5000
This guide assumes you stopped training at step 5000 (or any saved checkpoint) and now want to continue without restarting from scratch.
## What you need
1. **A GPU** with at least 80 GB VRAM (B200 / H200 / 2×H100 80GB).
2. **The full checkpoint folder** — published on this repo on the branch `resumable-step-5000`. Contains:
- `adapter_model.safetensors` (LoRA weights, ~155 MB)
- `adapter_config.json`
- `optimizer.pt` (8-bit AdamW state, ~80 MB)
- `scheduler.pt` (cosine LR schedule state)
- `rng_state.pth` (random state — needed for shuffle resume)
- `trainer_state.json` (step counter, loss history)
- `training_args.bin` (config snapshot)
- tokenizer files
3. **The training data** — 7.9 GB JSONL of `(bible→chapter)` examples, NOT published here (copyright). The owner has it staged at:
- workstation: `/home/fordoilcorp/booktrain/training/train_quality.jsonl`
- or wherever the owner has cold-storage backups
4. **The exact pinned Python stack** — see `requirements.txt` (also on this branch).
5. **The training script**`train_qlora_full.py` (also on this branch).
## Step-by-step resume
```bash
# 1. Set up the host (assumes Ubuntu 22.04 + CUDA 12.8 base image)
apt-get update && apt-get install -y python3-pip rsync git curl
pip install --upgrade pip
# 2. Install the pinned stack
pip install hf_transfer huggingface-hub==0.36.2
pip install torch==2.12.0 --index-url https://download.pytorch.org/whl/cu128
pip install -r requirements.txt
# 3. CRITICAL env var for bitsandbytes to find libnvJitLink.so.13
export LD_LIBRARY_PATH=$(python3 -c "import torch; import os; print(os.path.dirname(torch.__file__))")/../nvidia/cu13/lib:$LD_LIBRARY_PATH
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
export HF_HUB_ENABLE_HF_TRANSFER=1
export HF_TOKEN=<your hf token>
# 4. Pull the resumable checkpoint
mkdir -p /workspace/checkpoints
huggingface-cli download Fordentinc/book-builder-bookwriter-v1 \
--revision resumable-step-5000 \
--local-dir /workspace/checkpoints/checkpoint-5000
# 5. Pull the training script
huggingface-cli download Fordentinc/book-builder-bookwriter-v1 \
--revision resumable-step-5000 \
--include "train_qlora_full.py" \
--local-dir /workspace/training
# 6. Get the training data onto the host
# Option A: rsync from your workstation:
# rsync -av /home/fordoilcorp/booktrain/training/train_quality.jsonl <pod>:/workspace/data/
# rsync -av /home/fordoilcorp/booktrain/training/eval_quality.jsonl <pod>:/workspace/data/
# Option B: pull from a private HF dataset if one is set up later.
# 7. Resume training
cd /workspace/training
python3 train_qlora_full.py \
--base_model Qwen/Qwen2.5-7B \
--train_jsonl /workspace/data/train_quality.jsonl \
--eval_jsonl /workspace/data/eval_quality.jsonl \
--output_dir /workspace/checkpoints \
--max_seq 2048 \
--per_device_train_batch_size 4 \
--grad_accum 8 \
--lr 2e-4 \
--num_epochs 1.0 \
--warmup_ratio 0.03 \
--logging_steps 10 \
--save_steps 500 \
--eval_steps 500 \
--save_total_limit 3 \
--hub_repo_id Fordentinc/book-builder-bookwriter-v1 \
--hub_token $HF_TOKEN \
--resume_from_checkpoint /workspace/checkpoints/checkpoint-5000
```
The trainer will pick up at step 5001, with the optimizer momentum, the LR schedule position, and the RNG state restored exactly. Expected continuation: step 5001 → 9697 = 4696 steps × ~4.78s = **~6h 14m** of training, ~$26 on a $4.17/hr B200.
## What was tested
- Mechanism validated on this repo using `resumable-test-4500` branch (proved a full checkpoint folder uploads and re-downloads cleanly with all files intact).
## Things that are NOT in this branch (and where they live)
- **Base model `Qwen/Qwen2.5-7B`** — pulled from `huggingface.co/Qwen/Qwen2.5-7B` (Apache 2.0, public, will remain available).
- **Training corpus** — see point 3 above. NOT on HF.
- **Tokenize cache** — regenerated automatically on first run (~7 min on B200). Not worth shipping.
## Verifying the checkpoint before launching real training
After step 5 above, sanity check by loading the checkpoint:
```python
from transformers import AutoModelForCausalLM
from peft import PeftModel
import torch
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B", torch_dtype=torch.bfloat16, device_map="cuda:0")
model = PeftModel.from_pretrained(base, "/workspace/checkpoints/checkpoint-5000")
print("adapter loaded OK, trainable params:", sum(p.numel() for p in model.parameters() if p.requires_grad)/1e6, "M")
```
Expect: `~40.4 M`. If you see that, you can resume safely.
---
Last updated: 2026-05-28

24
resume/requirements.txt Normal file
View File

@@ -0,0 +1,24 @@
# Exact pinned versions for resuming book-builder-bookwriter-v1 training.
# These versions were verified working end-to-end on B200 (sm_100) and 4090 (sm_89).
# Install with:
# pip install -r requirements.txt --index-url https://download.pytorch.org/whl/cu128
# (only torch needs cu128 wheel; rest install from PyPI normally — see install commands below)
# === Core (install via cu128 PyTorch index) ===
torch==2.12.0
triton==3.7.0
# === HF stack ===
transformers==4.46.3
accelerate==1.1.1
datasets==3.1.0
peft==0.13.2
bitsandbytes==0.49.2
huggingface-hub==0.36.2
hf-transfer==0.1.9
safetensors==0.7.0
sentencepiece==0.2.1
protobuf==7.35.0
tokenizers==0.20.3
tensorboard==2.20.0
numpy==2.4.6

208
resume/train_qlora_full.py Normal file
View File

@@ -0,0 +1,208 @@
#!/usr/bin/env python3
"""
Production QLoRA training for BookBuilder bookwriter v1.
Same recipe as smoke_qlora.py, scaled up via HF Trainer.
Default target: Qwen 2.5 7B, 1.82B-token corpus, 1 epoch, ctx 2048.
"""
import os, sys, json, argparse, time
from pathlib import Path
import torch
from datasets import load_dataset
from transformers import (
AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig,
Trainer, TrainingArguments, DataCollatorForLanguageModeling,
)
from peft import LoraConfig, get_peft_model, prepare_model_for_kbit_training
def parse_args():
p = argparse.ArgumentParser()
p.add_argument("--base_model", default="Qwen/Qwen2.5-7B")
p.add_argument("--train_jsonl", required=True)
p.add_argument("--eval_jsonl", default=None)
p.add_argument("--output_dir", required=True)
p.add_argument("--max_seq", type=int, default=2048)
p.add_argument("--per_device_train_batch_size", type=int, default=8)
p.add_argument("--per_device_eval_batch_size", type=int, default=8)
p.add_argument("--grad_accum", type=int, default=4)
p.add_argument("--lr", type=float, default=2e-4)
p.add_argument("--num_epochs", type=float, default=1.0)
p.add_argument("--warmup_ratio", type=float, default=0.03)
p.add_argument("--lora_r", type=int, default=16)
p.add_argument("--lora_alpha", type=int, default=32)
p.add_argument("--lora_dropout", type=float, default=0.05)
p.add_argument("--save_steps", type=int, default=500)
p.add_argument("--eval_steps", type=int, default=500)
p.add_argument("--logging_steps", type=int, default=20)
p.add_argument("--save_total_limit", type=int, default=3)
p.add_argument("--hub_repo_id", default=None,
help="If set, push checkpoints to this HF repo each save.")
p.add_argument("--hub_token", default=None)
p.add_argument("--max_train_samples", type=int, default=None,
help="Cap for sanity runs.")
p.add_argument("--seed", type=int, default=42)
p.add_argument("--gradient_checkpointing", action="store_true", default=False)
p.add_argument("--no_eval", action="store_true")
return p.parse_args()
def main():
args = parse_args()
print(f"=== BookBuilder QLoRA train ===", flush=True)
print(f"base: {args.base_model}")
print(f"train: {args.train_jsonl}")
print(f"eval : {args.eval_jsonl}")
print(f"out : {args.output_dir}")
print(f"ctx : {args.max_seq} bs/dev: {args.per_device_train_batch_size} ga: {args.grad_accum} lr: {args.lr}", flush=True)
# ---------- tokenizer ----------
tok = AutoTokenizer.from_pretrained(args.base_model, use_fast=True)
if tok.pad_token is None:
tok.pad_token = tok.eos_token
tok.padding_side = "right"
# ---------- model: 4-bit NF4 ----------
bnb = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True,
)
print("Loading 4-bit base...", flush=True)
t0 = time.time()
model = AutoModelForCausalLM.from_pretrained(
args.base_model,
quantization_config=bnb,
torch_dtype=torch.bfloat16,
attn_implementation="sdpa",
device_map="cuda:0",
)
model.config._attn_implementation = "sdpa"
model.config.use_cache = False
print(f" base loaded in {time.time()-t0:.1f}s | VRAM {torch.cuda.memory_allocated()/1e9:.2f} GB", flush=True)
model = prepare_model_for_kbit_training(
model, use_gradient_checkpointing=args.gradient_checkpointing,
)
lora = LoraConfig(
r=args.lora_r,
lora_alpha=args.lora_alpha,
lora_dropout=args.lora_dropout,
bias="none",
task_type="CAUSAL_LM",
target_modules=["q_proj","k_proj","v_proj","o_proj","gate_proj","up_proj","down_proj"],
)
model = get_peft_model(model, lora)
trainable = sum(p.numel() for p in model.parameters() if p.requires_grad)
total = sum(p.numel() for p in model.parameters())
print(f" trainable: {trainable/1e6:.2f}M / {total/1e6:.1f}M ({100*trainable/total:.3f}%)", flush=True)
# ---------- dataset ----------
data_files = {"train": args.train_jsonl}
if args.eval_jsonl and not args.no_eval:
data_files["eval"] = args.eval_jsonl
ds = load_dataset("json", data_files=data_files)
if args.max_train_samples:
ds["train"] = ds["train"].shuffle(seed=args.seed).select(range(args.max_train_samples))
print(f" train rows: {len(ds['train']):,}", flush=True)
if "eval" in ds:
print(f" eval rows : {len(ds['eval']):,}", flush=True)
def tokenize_fn(batch):
out = tok(
batch["text"],
truncation=True,
max_length=args.max_seq,
padding=False,
)
return out
# Explicit cache paths — HF datasets' default fingerprint isn't stable across
# Python processes (tokenizer object hash differs), so a plain .map() re-tokenizes
# every fresh launch. Pin the cache to a deterministic path so subsequent runs hit it.
cache_root = os.path.dirname(os.path.abspath(args.train_jsonl))
tag = f"qwen-ctx{args.max_seq}"
cache_files = {
split: os.path.join(cache_root, f"tok_cache_{split}_{tag}.arrow")
for split in ds.keys()
}
for split, path in cache_files.items():
print(f" tokenize cache[{split}] -> {path}", flush=True)
tokenized = ds.map(
tokenize_fn,
batched=True,
remove_columns=ds["train"].column_names,
num_proc=8,
desc="tokenize",
cache_file_names=cache_files,
load_from_cache_file=True,
)
collator = DataCollatorForLanguageModeling(tokenizer=tok, mlm=False)
# ---------- trainer ----------
push_to_hub = bool(args.hub_repo_id)
targs = TrainingArguments(
output_dir=args.output_dir,
overwrite_output_dir=False,
seed=args.seed,
num_train_epochs=args.num_epochs,
per_device_train_batch_size=args.per_device_train_batch_size,
per_device_eval_batch_size=args.per_device_eval_batch_size,
gradient_accumulation_steps=args.grad_accum,
learning_rate=args.lr,
warmup_ratio=args.warmup_ratio,
lr_scheduler_type="cosine",
bf16=True,
fp16=False,
tf32=True,
gradient_checkpointing=args.gradient_checkpointing,
logging_steps=args.logging_steps,
save_steps=args.save_steps,
eval_strategy="steps" if "eval" in tokenized else "no",
eval_steps=args.eval_steps if "eval" in tokenized else None,
save_total_limit=args.save_total_limit,
report_to="tensorboard",
push_to_hub=push_to_hub,
hub_model_id=args.hub_repo_id if push_to_hub else None,
hub_token=args.hub_token,
hub_strategy="every_save" if push_to_hub else "end",
hub_private_repo=False,
dataloader_num_workers=4,
dataloader_pin_memory=True,
optim="paged_adamw_8bit",
remove_unused_columns=False,
)
trainer_kwargs = dict(
model=model,
args=targs,
train_dataset=tokenized["train"],
eval_dataset=tokenized.get("eval"),
data_collator=collator,
)
# transformers 4.46 uses `tokenizer=`; 5.x uses `processing_class=`
import inspect
if "processing_class" in inspect.signature(Trainer.__init__).parameters:
trainer_kwargs["processing_class"] = tok
else:
trainer_kwargs["tokenizer"] = tok
trainer = Trainer(**trainer_kwargs)
print(f"=== begin training ===", flush=True)
trainer.train()
print(f"=== saving final adapter ===", flush=True)
trainer.save_model(args.output_dir)
tok.save_pretrained(args.output_dir)
if push_to_hub:
trainer.push_to_hub(commit_message="final adapter")
# Sentinel
Path(args.output_dir).joinpath(".train_complete").touch()
print("DONE.", flush=True)
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e930ea705203c8ca962ea970b90af84c09319fbd04d5e7d37faf8fb8f9ff0aab
size 5680

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:312850f64d2b8a08b65d8341c2eca45b375f804520c9c381627bbbbcd3b786cf
size 5886

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f47163fd0b2a395f78eb79c029455d813e8f22445974e21e893a165f46381c43
size 113842

31
special_tokens_map.json Normal file
View File

@@ -0,0 +1,31 @@
{
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<|object_ref_start|>",
"<|object_ref_end|>",
"<|box_start|>",
"<|box_end|>",
"<|quad_start|>",
"<|quad_end|>",
"<|vision_start|>",
"<|vision_end|>",
"<|vision_pad|>",
"<|image_pad|>",
"<|video_pad|>"
],
"eos_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

3
tokenizer.json Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9c5ae00e602b8860cbd784ba82a8aa14e8feecec692e7076590d014d7b7fdafa
size 11421896

207
tokenizer_config.json Normal file
View File

@@ -0,0 +1,207 @@
{
"add_bos_token": false,
"add_prefix_space": false,
"added_tokens_decoder": {
"151643": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151644": {
"content": "<|im_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151645": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151646": {
"content": "<|object_ref_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151647": {
"content": "<|object_ref_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151648": {
"content": "<|box_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151649": {
"content": "<|box_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151650": {
"content": "<|quad_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151651": {
"content": "<|quad_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151652": {
"content": "<|vision_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151653": {
"content": "<|vision_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151654": {
"content": "<|vision_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151655": {
"content": "<|image_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151656": {
"content": "<|video_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151657": {
"content": "<tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151658": {
"content": "</tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151659": {
"content": "<|fim_prefix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151660": {
"content": "<|fim_middle|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151661": {
"content": "<|fim_suffix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151662": {
"content": "<|fim_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151663": {
"content": "<|repo_name|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151664": {
"content": "<|file_sep|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
}
},
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<|object_ref_start|>",
"<|object_ref_end|>",
"<|box_start|>",
"<|box_end|>",
"<|quad_start|>",
"<|quad_end|>",
"<|vision_start|>",
"<|vision_end|>",
"<|vision_pad|>",
"<|image_pad|>",
"<|video_pad|>"
],
"bos_token": null,
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- 'You are a helpful assistant.' }}\n {%- endif %}\n {{- \"\\n\\n# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0]['role'] == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}\n {%- else %}\n {{- '<|im_start|>system\\nYou are a helpful assistant.<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) or (message.role == \"assistant\" and not message.tool_calls) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role }}\n {%- if message.content %}\n {{- '\\n' + message.content }}\n {%- endif %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '\\n<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n",
"clean_up_tokenization_spaces": false,
"eos_token": "<|endoftext|>",
"errors": "replace",
"model_max_length": 131072,
"pad_token": "<|endoftext|>",
"split_special_tokens": false,
"tokenizer_class": "Qwen2Tokenizer",
"unk_token": null
}

3
training_args.bin Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a2a8e9d0dc43c964187b7c2af81e8478e3438239234b13e717d93607fd9ef92c
size 5777

1
vocab.json Normal file

File diff suppressed because one or more lines are too long