MrPIck commited on
Commit
fdb8394
·
verified ·
1 Parent(s): 19d2829

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Qwen/Qwen2.5-1.5B-Instruct
3
+ library_name: peft
4
+ pipeline_tag: text-generation
5
+ license: apache-2.0
6
+ language:
7
+ - en
8
+ tags:
9
+ - lora
10
+ - transformers
11
+ - style-transfer
12
+ - copywriting
13
+ ---
14
+
15
+ # pickbits-voice-daily-v1
16
+
17
+ A LoRA adapter that writes in the house voice of [PickBits Daily Signal](https://pickbits.ai),
18
+ trained on ~4 months of shipped, human-approved editorial content. Style-transfer proof of
19
+ concept: the adapter reliably reproduces the publication's register, structure, and cadence on
20
+ unseen topics, where the base model produces generic (often wrong-genre) text.
21
+
22
+ - **Base model:** Qwen/Qwen2.5-1.5B-Instruct (frozen; this repo contains only the adapter)
23
+ - **Method:** plain bf16 LoRA — r=16, alpha=32, dropout 0.05, targeting
24
+ q/k/v/o + gate/up/down projections (18.46M trainable params, 1.18% of base)
25
+ - **Data:** 815 chat-format pairs harvested from shipped content (94 daily editions:
26
+ story sections, tl;dr bullets, standfirsts; plus devlog social captions).
27
+ 40 pairs from the newest publication dates held out — zero date leakage.
28
+ - **Training:** 3 epochs / 153 steps, lr 1e-4 cosine, effective batch 16, max_len 1024,
29
+ assistant-only loss masking. 19.5 min on a single RTX 3080 Ti (12 GB). Loss 2.98 → 2.39.
30
+
31
+ ## Before / after (held-out prompt, never seen in training)
32
+
33
+ Prompt: *Engine: daily-signal / Task: story section / Heading: "Google put a deepfake button
34
+ on the whole planet — then yanked it inside a day." / Seed: "The tool didn't invent fakery…"*
35
+
36
+ **Base Qwen2.5-1.5B-Instruct:**
37
+ > In an era where truth was as elusive as a shadow cast by a passing cloud, humanity found
38
+ > itself at the mercy of an unprecedented technology…
39
+
40
+ (Dystopian fiction — wrong genre entirely.)
41
+
42
+ **With this adapter:**
43
+ > The tool didn't invent fakery; it let a lie inherit the credibility of the real map
44
+ > underneath it. On Monday, August 1, Google's…
45
+
46
+ (Correct genre, register, and house structure: seed-line opener, declarative key-fact cadence.)
47
+
48
+ ## Usage
49
+
50
+ ```python
51
+ from transformers import AutoModelForCausalLM, AutoTokenizer
52
+ from peft import PeftModel
53
+ import torch
54
+
55
+ base = "Qwen/Qwen2.5-1.5B-Instruct"
56
+ tok = AutoTokenizer.from_pretrained(base)
57
+ model = AutoModelForCausalLM.from_pretrained(base, dtype=torch.bfloat16, device_map="auto")
58
+ model = PeftModel.from_pretrained(model, "MrPIck/pickbits-voice-daily-v1")
59
+
60
+ messages = [
61
+ {"role": "system", "content": "You are the PickBits staff writer. Write in the house voice."},
62
+ {"role": "user", "content": "Engine: daily-signal\nTask: tldr bullet\nSeed: EU AI Act enforcement began today with..."},
63
+ ]
64
+ ids = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt", return_dict=False).to(model.device)
65
+ out = model.generate(ids, max_new_tokens=400, temperature=0.7, top_p=0.9, do_sample=True)
66
+ print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))
67
+ ```
68
+
69
+ ## Limitations
70
+
71
+ - **Style, not knowledge.** Prompts in training carried only a heading and seed sentence, so
72
+ the adapter learned voice and structure — it will confidently invent facts. Feed real
73
+ source facts in the prompt; let the adapter supply only the how, not the what.
74
+ - Trained for specific task framings (`Engine: daily-signal`, `Task: story section |
75
+ tldr bullet | edition standfirst`); other prompt shapes are out of distribution.
76
+ - English only; single narrow editorial voice by design.
77
+
78
+ ## Provenance
79
+
80
+ Training data is proprietary shipped editorial content from PickBits (not included in this
81
+ repo). Adapter weights only. Built as a one-off proof of concept for a
82
+ harvest → pairs → LoRA → held-out-eval pipeline, 2026-08-09.
adapter_config.json ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "Qwen/Qwen2.5-1.5B-Instruct",
7
+ "bias": "none",
8
+ "corda_config": null,
9
+ "ensure_weight_tying": false,
10
+ "eva_config": null,
11
+ "exclude_modules": null,
12
+ "fan_in_fan_out": false,
13
+ "inference_mode": true,
14
+ "init_lora_weights": true,
15
+ "layer_replication": null,
16
+ "layers_pattern": null,
17
+ "layers_to_transform": null,
18
+ "loftq_config": {},
19
+ "lora_alpha": 32,
20
+ "lora_bias": false,
21
+ "lora_dropout": 0.05,
22
+ "lora_ga_config": null,
23
+ "megatron_config": null,
24
+ "megatron_core": "megatron.core",
25
+ "modules_to_save": null,
26
+ "monteclora_config": null,
27
+ "peft_type": "LORA",
28
+ "peft_version": "0.20.0",
29
+ "qalora_group_size": 16,
30
+ "r": 16,
31
+ "rank_pattern": {},
32
+ "revision": null,
33
+ "target_modules": [
34
+ "v_proj",
35
+ "gate_proj",
36
+ "q_proj",
37
+ "down_proj",
38
+ "k_proj",
39
+ "up_proj",
40
+ "o_proj"
41
+ ],
42
+ "target_parameters": null,
43
+ "task_type": "CAUSAL_LM",
44
+ "trainable_token_indices": null,
45
+ "use_bdlora": null,
46
+ "use_dora": false,
47
+ "use_qalora": false,
48
+ "use_rslora": false,
49
+ "velora_config": null
50
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bbad714429e5bd30c5af0790ceac0527bb198a0ab344fdefc316d159215c71e0
3
+ size 73911112
chat_template.jinja ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0]['role'] == 'system' %}
4
+ {{- messages[0]['content'] }}
5
+ {%- else %}
6
+ {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}
7
+ {%- endif %}
8
+ {{- "\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>" }}
9
+ {%- for tool in tools %}
10
+ {{- "\n" }}
11
+ {{- tool | tojson }}
12
+ {%- endfor %}
13
+ {{- "\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" }}
14
+ {%- else %}
15
+ {%- if messages[0]['role'] == 'system' %}
16
+ {{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
17
+ {%- else %}
18
+ {{- '<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n' }}
19
+ {%- endif %}
20
+ {%- endif %}
21
+ {%- for message in messages %}
22
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %}
23
+ {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
24
+ {%- elif message.role == "assistant" %}
25
+ {{- '<|im_start|>' + message.role }}
26
+ {%- if message.content %}
27
+ {{- '\n' + message.content }}
28
+ {%- endif %}
29
+ {%- for tool_call in message.tool_calls %}
30
+ {%- if tool_call.function is defined %}
31
+ {%- set tool_call = tool_call.function %}
32
+ {%- endif %}
33
+ {{- '\n<tool_call>\n{"name": "' }}
34
+ {{- tool_call.name }}
35
+ {{- '", "arguments": ' }}
36
+ {{- tool_call.arguments | tojson }}
37
+ {{- '}\n</tool_call>' }}
38
+ {%- endfor %}
39
+ {{- '<|im_end|>\n' }}
40
+ {%- elif message.role == "tool" %}
41
+ {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %}
42
+ {{- '<|im_start|>user' }}
43
+ {%- endif %}
44
+ {{- '\n<tool_response>\n' }}
45
+ {{- message.content }}
46
+ {{- '\n</tool_response>' }}
47
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
48
+ {{- '<|im_end|>\n' }}
49
+ {%- endif %}
50
+ {%- endif %}
51
+ {%- endfor %}
52
+ {%- if add_generation_prompt %}
53
+ {{- '<|im_start|>assistant\n' }}
54
+ {%- endif %}
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2f55e63353d3d978b390d346bae531be8b83bc9532c0be500d62b7253aa4c595
3
+ size 11421991
tokenizer_config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": null,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "extra_special_tokens": [
9
+ "<|im_start|>",
10
+ "<|im_end|>",
11
+ "<|object_ref_start|>",
12
+ "<|object_ref_end|>",
13
+ "<|box_start|>",
14
+ "<|box_end|>",
15
+ "<|quad_start|>",
16
+ "<|quad_end|>",
17
+ "<|vision_start|>",
18
+ "<|vision_end|>",
19
+ "<|vision_pad|>",
20
+ "<|image_pad|>",
21
+ "<|video_pad|>"
22
+ ],
23
+ "is_local": false,
24
+ "local_files_only": false,
25
+ "model_max_length": 131072,
26
+ "pad_token": "<|endoftext|>",
27
+ "split_special_tokens": false,
28
+ "tokenizer_class": "Qwen2Tokenizer",
29
+ "unk_token": null
30
+ }