66 lines
1.9 KiB
Markdown
66 lines
1.9 KiB
Markdown
---
|
|
library_name: transformers
|
|
license: apache-2.0
|
|
language:
|
|
- en
|
|
base_model:
|
|
- Qwen/Qwen3-4B-Instruct-2507
|
|
- TakaTaka3/qwen3-4b-lora-adapter_V4
|
|
pipeline_tag: text-generation
|
|
datasets:
|
|
- u-10bei/structured_data_with_cot_dataset_512_v2
|
|
---
|
|
|
|
# TakaTaka3/Qwen3-4B-Instruct-2507-sft-merged_V2
|
|
|
|
This repository provides a **Merged model** fine-tuned from
|
|
**Qwen/Qwen3-4B-Instruct-2507** using **QLoRA (4-bit, Unsloth)**.
|
|
|
|
This repository contains the merged model that merged **base model (Qwen/Qwen3-4B-Instruct-2507)** and **LoRA adapter weights (TakaTaka3/qwen3-4b-lora-adapter_V4)**
|
|
.
|
|
|
|
## Training Objective
|
|
|
|
This adapter is trained to improve **structured output accuracy**
|
|
(JSON / YAML / XML / TOML / CSV).
|
|
|
|
Loss is applied only to the final assistant output,
|
|
while intermediate reasoning (Chain-of-Thought) is masked.
|
|
|
|
## Training Configuration
|
|
|
|
- Base model: Qwen/Qwen3-4B-Instruct-2507
|
|
- Method: QLoRA (4-bit)
|
|
- Max sequence length: 2048
|
|
- Epochs: 1
|
|
- Learning rate: 2e-06
|
|
- LoRA: r=64, alpha=128
|
|
|
|
## Usage
|
|
|
|
```python
|
|
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
import torch
|
|
|
|
model_id = "TakaTaka3/Qwen3-4B-Instruct-2507-sft-merged_V2"
|
|
|
|
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
|
model = AutoModelForCausalLM.from_pretrained(
|
|
model_id,
|
|
torch_dtype=torch.float16,
|
|
device_map="auto"
|
|
)
|
|
|
|
# Test inference
|
|
prompt = "Your question here"
|
|
inputs = tokenizer.apply_chat_template([{"role": "user", "content": prompt}], tokenize=True, add_generation_prompt=True, return_tensors="pt").to("cuda")
|
|
outputs = model.generate(**inputs, max_new_tokens=512)
|
|
print(tokenizer.decode(outputs[0]))
|
|
```
|
|
|
|
## Sources & Terms (IMPORTANT)
|
|
|
|
Training data: u-10bei/structured_data_with_cot_dataset_512_v2
|
|
|
|
Dataset License: MIT License. This dataset is used and distributed under the terms of the MIT License.
|
|
Compliance: Users must comply with the MIT license (including copyright notice) and the base model's original terms of use. |