Mani124124 commited on
Commit
c903195
·
verified ·
1 Parent(s): 9907fc4

Upload folder using huggingface_hub

Browse files
README.md CHANGED
@@ -1,25 +1,65 @@
1
  ---
2
- base_model: Qwen/Qwen3-4B-Instruct-2507
 
 
 
 
 
3
  library_name: peft
4
  pipeline_tag: text-generation
5
  tags:
 
6
  - lora
7
  - structured-output
8
  ---
9
 
10
- # structeval-lora (LoRA adapter)
11
 
12
- LoRA adapter for the StructEval-style structured output main competition.
 
13
 
14
- ## Base model
15
- - `Qwen/Qwen3-4B-Instruct-2507`
16
 
17
- ## Training data (allowed list)
18
- - `daichira/structured-hard-sft-4k` (SFT)
19
 
20
- ## Method
21
- - LoRA fine-tuning (completion-only: learns the final assistant output)
22
 
23
- ## Notes
24
- - This adapter was trained locally on macOS (MPS) as a quick end-to-end pipeline check.
25
- - For better scores, train longer on the full allowed datasets (and optionally DPO) and generate the final `inference.json` using the official inference workflow.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ base_model: unsloth/Qwen3-4B-Instruct-2507
3
+ datasets:
4
+ - u-10bei/structured_data_with_cot_dataset_512_v5
5
+ language:
6
+ - en
7
+ license: apache-2.0
8
  library_name: peft
9
  pipeline_tag: text-generation
10
  tags:
11
+ - qlora
12
  - lora
13
  - structured-output
14
  ---
15
 
16
+ <【課題】ここは自分で記入して下さい>
17
 
18
+ This repository provides a **LoRA adapter** fine-tuned from
19
+ **unsloth/Qwen3-4B-Instruct-2507** using **QLoRA (4-bit, Unsloth)**.
20
 
21
+ This repository contains **LoRA adapter weights only**.
22
+ The base model must be loaded separately.
23
 
24
+ ## Training Objective
 
25
 
26
+ This adapter is trained to improve **structured output accuracy**
27
+ (JSON / YAML / XML / TOML / CSV).
28
 
29
+ Loss is applied only to the final assistant output,
30
+ while intermediate reasoning (Chain-of-Thought) is masked.
31
+
32
+ ## Training Configuration
33
+
34
+ - Base model: unsloth/Qwen3-4B-Instruct-2507
35
+ - Method: QLoRA (4-bit)
36
+ - Max sequence length: 256
37
+ - Epochs: 1
38
+ - Learning rate: 5e-05
39
+ - LoRA: r=16, alpha=32
40
+
41
+ ## Usage
42
+
43
+ ```python
44
+ from transformers import AutoModelForCausalLM, AutoTokenizer
45
+ from peft import PeftModel
46
+ import torch
47
+
48
+ base = "unsloth/Qwen3-4B-Instruct-2507"
49
+ adapter = "your_id/your-repo"
50
+
51
+ tokenizer = AutoTokenizer.from_pretrained(base)
52
+ model = AutoModelForCausalLM.from_pretrained(
53
+ base,
54
+ torch_dtype=torch.float16,
55
+ device_map="auto",
56
+ )
57
+ model = PeftModel.from_pretrained(model, adapter)
58
+ ```
59
+
60
+ ## Sources & Terms (IMPORTANT)
61
+
62
+ Training data: u-10bei/structured_data_with_cot_dataset_512_v5
63
+
64
+ Dataset License: MIT License. This dataset is used and distributed under the terms of the MIT License.
65
+ Compliance: Users must comply with the MIT license (including copyright notice) and the base model's original terms of use.
adapter_config.json CHANGED
@@ -3,7 +3,7 @@
3
  "alpha_pattern": {},
4
  "arrow_config": null,
5
  "auto_mapping": null,
6
- "base_model_name_or_path": "Qwen/Qwen3-4B-Instruct-2507",
7
  "bias": "none",
8
  "corda_config": null,
9
  "ensure_weight_tying": false,
@@ -18,7 +18,7 @@
18
  "loftq_config": {},
19
  "lora_alpha": 32,
20
  "lora_bias": false,
21
- "lora_dropout": 0.0,
22
  "megatron_config": null,
23
  "megatron_core": "megatron.core",
24
  "modules_to_save": null,
@@ -29,13 +29,13 @@
29
  "rank_pattern": {},
30
  "revision": null,
31
  "target_modules": [
32
- "q_proj",
33
- "up_proj",
34
  "k_proj",
35
- "down_proj",
36
- "gate_proj",
37
  "o_proj",
38
- "v_proj"
 
 
 
 
39
  ],
40
  "target_parameters": null,
41
  "task_type": "CAUSAL_LM",
 
3
  "alpha_pattern": {},
4
  "arrow_config": null,
5
  "auto_mapping": null,
6
+ "base_model_name_or_path": "unsloth/Qwen3-4B-Instruct-2507",
7
  "bias": "none",
8
  "corda_config": null,
9
  "ensure_weight_tying": false,
 
18
  "loftq_config": {},
19
  "lora_alpha": 32,
20
  "lora_bias": false,
21
+ "lora_dropout": 0.05,
22
  "megatron_config": null,
23
  "megatron_core": "megatron.core",
24
  "modules_to_save": null,
 
29
  "rank_pattern": {},
30
  "revision": null,
31
  "target_modules": [
 
 
32
  "k_proj",
 
 
33
  "o_proj",
34
+ "q_proj",
35
+ "v_proj",
36
+ "gate_proj",
37
+ "up_proj",
38
+ "down_proj"
39
  ],
40
  "target_parameters": null,
41
  "task_type": "CAUSAL_LM",
adapter_model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fd3b9a66dc6d6b977afa71f191fca485dae248e56d717b4e2b1d66a7addad6f1
3
  size 132187888
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:736ece3c4c8255bc354810158945800126dccff05fea5db4e20e5ce6d3f0542f
3
  size 132187888
tokenizer_config.json CHANGED
@@ -21,8 +21,10 @@
21
  "<|video_pad|>"
22
  ],
23
  "is_local": false,
24
- "model_max_length": 1010000,
25
- "pad_token": "<|endoftext|>",
 
 
26
  "split_special_tokens": false,
27
  "tokenizer_class": "Qwen2Tokenizer",
28
  "unk_token": null
 
21
  "<|video_pad|>"
22
  ],
23
  "is_local": false,
24
+ "model_max_length": 262144,
25
+ "model_specific_special_tokens": {},
26
+ "pad_token": "<|vision_pad|>",
27
+ "padding_side": "left",
28
  "split_special_tokens": false,
29
  "tokenizer_class": "Qwen2Tokenizer",
30
  "unk_token": null