Honejudo1234 commited on
Commit
40f22cc
·
verified ·
1 Parent(s): 1ccf499

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +82 -13
README.md CHANGED
@@ -1,21 +1,90 @@
1
  ---
2
- base_model: unsloth/qwen3-4b-instruct-2507-unsloth-bnb-4bit
3
- tags:
4
- - text-generation-inference
5
- - transformers
6
- - unsloth
7
- - qwen3
8
- license: apache-2.0
9
  language:
10
  - en
 
 
 
 
 
 
 
 
11
  ---
12
 
13
- # Uploaded finetuned model
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
- - **Developed by:** Honejudo1234
16
- - **License:** apache-2.0
17
- - **Finetuned from model :** unsloth/qwen3-4b-instruct-2507-unsloth-bnb-4bit
18
 
19
- This qwen3 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
20
 
21
- [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
 
 
 
1
  ---
2
+ base_model: Qwen/Qwen3-4B-Instruct-2507
3
+ datasets:
4
+ - u-10bei/dpo-dataset-qwen-cot
 
 
 
 
5
  language:
6
  - en
7
+ license: apache-2.0
8
+ library_name: transformers
9
+ pipeline_tag: text-generation
10
+ tags:
11
+ - dpo
12
+ - unsloth
13
+ - qwen
14
+ - alignment
15
  ---
16
 
17
+ # # qwen3-4b-dpo-qwen-cot-merged
18
+
19
+ This model is a fine-tuned version of **Qwen/Qwen3-4B-Instruct-2507** using **Direct Preference Optimization (DPO)** via the **Unsloth** library.
20
+
21
+ This repository contains the **full-merged 16-bit weights**. No adapter loading is required.
22
+
23
+ ## Training Objective
24
+ This model has been optimized using DPO to align its responses with preferred outputs, focusing on improving reasoning (Chain-of-Thought) and structured response quality based on the provided preference dataset.
25
+
26
+ ## Training Configuration
27
+ ### Core Hyperparameters
28
+ | Parameter | Value |
29
+ |-----------|-------|
30
+ | **Base Model** | Qwen/Qwen3-4B-Instruct-2507 |
31
+ | **Method** | DPO (Direct Preference Optimization) |
32
+ | **Learning Rate** | 5e-07 |
33
+ | **Beta** | 0.2 |
34
+ | **Epochs** | 1 |
35
+ | **Max Sequence Length** | 1024 |
36
+
37
+ ### **Batch Size Configuration**
38
+ | Parameter | Value |
39
+ |-----------|-------|
40
+ | **Per Device Train Batch Size** | 2 |
41
+ | **Gradient Accumulation Steps** | 8 |
42
+ | **Effective Batch Size** | 16 |
43
+
44
+ > **Note**: The effective batch size is calculated as:
45
+ > `Effective Batch Size = per_device_batch_size × gradient_accumulation_steps × num_gpus`
46
+
47
+ ### LoRA Configuration
48
+ | Parameter | Value |
49
+ |-----------|-------|
50
+ | **LoRA Rank (r)** | 8 |
51
+ | **LoRA Alpha** | 16 |
52
+ | **LoRA Dropout** | 0 |
53
+ | **Target Modules** | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
54
+ | **Status** | Merged into base model (16-bit) |
55
+
56
+ ### Optimizer Settings
57
+ | Parameter | Value |
58
+ |-----------|-------|
59
+ | **Optimizer** | OptimizerNames.ADAMW_8BIT |
60
+ | **Weight Decay** | 0.01 |
61
+ | **Warmup Ratio** | 0.1 |
62
+ ## Usage
63
+ Since this is a merged model, you can use it directly with `transformers`.
64
+
65
+ ```python
66
+ from transformers import AutoModelForCausalLM, AutoTokenizer
67
+ import torch
68
+
69
+ model_id = "your_id/your-repo-name"
70
+
71
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
72
+ model = AutoModelForCausalLM.from_pretrained(
73
+ model_id,
74
+ torch_dtype=torch.float16,
75
+ device_map="auto"
76
+ )
77
+
78
+ # Test inference
79
+ prompt = "Your question here"
80
+ inputs = tokenizer.apply_chat_template([{"role": "user", "content": prompt}], tokenize=True, add_generation_prompt=True, return_tensors="pt").to("cuda")
81
+ outputs = model.generate(**inputs, max_new_tokens=512)
82
+ print(tokenizer.decode(outputs[0]))
83
 
84
+ ```
 
 
85
 
86
+ ## Sources & License (IMPORTANT)
87
 
88
+ * **Training Data**: [u-10bei/dpo-dataset-qwen-cot]
89
+ * **License**: MIT License. (As per dataset terms).
90
+ * **Compliance**: Users must follow the original base model's license terms.