amkyawdev commited on
Commit
209dc94
Β·
verified Β·
1 Parent(s): 693a4c2

Update README.md: add training details, fix AutoModelForCausalLM, update model overview

Browse files
Files changed (1) hide show
  1. README.md +71 -65
README.md CHANGED
@@ -24,96 +24,109 @@ model-index:
24
  results:
25
  - task:
26
  type: text-generation
27
- name: Code Generation
28
  dataset:
29
  name: HumanEval
30
  type: openai/openai_humaneval
31
  metrics:
32
  - type: pass_at_1
33
- value: 50.0
34
  verified: false
35
  - type: pass_at_10
36
- value: 75.0
37
  verified: false
38
  - task:
39
  type: text-generation
40
- name: Python Code Generation
41
  dataset:
42
  name: MBPP
43
  type: abdshhayan/MBPP
44
  metrics:
45
  - type: pass_at_1
46
- value: 55.0
47
  verified: false
48
  ---
49
 
50
- # πŸ€– amk-coder-v2
51
 
52
- Myanmar Coding Assistant - Fine-tuned from **Qwen2.5-Coder-1.5B**
53
 
54
- [![Model](https://img.shields.io/badge/Model-Size-2B-blue)](https://huggingface.co/amkyawdev/amk-coder-v2)
55
- [![License](https://img.shields.io/badge/License-Apache--2.0-green)](LICENSE)
56
- [![HuggingFace](https://img.shields.io/badge/πŸ€—-HuggingFace-orange)](https://huggingface.co/amkyawdev/amk-coder-v2)
57
 
58
  ---
59
 
60
  ## πŸ“‹ Table of Contents
61
 
62
- - [Features](#-features)
63
- - [Model Details](#-model-details)
64
- - [Quick Start](#-quick-start)
65
- - [Usage Examples](#-usage-examples)
66
- - [API Endpoints](#-api-endpoints)
67
- - [Deployment](#-deployment)
68
- - [Limitations](#-limitations)
69
- - [License](#-license)
70
 
71
  ---
72
 
73
- ## ✨ Features
74
 
75
- | Feature | Description |
76
- |---------|-------------|
77
- | πŸ‡²πŸ‡² **Myanmar Support** | Full support for Myanmar Unicode text |
78
- | πŸ’» **Code Generation** | Python, JavaScript, C++, Java, and more |
79
- | πŸ› **Debugging** | Bug detection and fixes |
80
- | πŸ“– **Code Explanation** | Line-by-line explanations |
81
- | πŸ” **Web Search** | Integration for latest documentation |
82
- | 🌐 **Streaming** | Real-time response streaming |
83
- | 🎨 **Beautiful UI** | Modern chat interface |
84
-
85
- ---
86
-
87
- ## πŸ“Š Model Details
88
 
89
  | Attribute | Value |
90
- |-----------|-------|
91
  | **Base Model** | Qwen2.5-Coder-1.5B |
92
  | **Parameters** | 2B (2,000M) |
93
  | **Architecture** | Qwen2ForCausalLM |
94
- | **Hidden Size** | 1536 |
95
- | **Layers** | 28 |
96
- | **Attention Heads** | 12 |
97
- | **Vocab Size** | 151,936 |
98
  | **Context Length** | 32,768 tokens |
99
- | **Tensor Type** | BF16 |
100
- | **Format** | Safetensors |
101
  | **License** | Apache-2.0 |
 
 
 
 
 
 
 
 
 
 
102
 
103
- ### Training Details
 
 
104
 
105
  | Parameter | Value |
106
- |-----------|-------|
107
  | **Framework** | Transformers + PEFT |
108
  | **Training Method** | LoRA fine-tuning |
109
- | **Learning Rate** | 2e-4 |
 
 
110
  | **Epochs** | 3 |
111
  | **Batch Size** | 8 |
112
  | **Max Length** | 2048 |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
 
114
  ---
115
 
116
- ## πŸš€ Quick Start
117
 
118
  ### Using Transformers (Python)
119
 
@@ -123,7 +136,7 @@ from transformers import pipeline
123
 
124
  pipe = pipeline("text-generation", model="amkyawdev/amk-coder-v2")
125
  messages = [
126
- {"role": "user", "content": "Python α€”α€²α€· list comprehension ရေးပါ"}
127
  ]
128
  result = pipe(messages, max_new_tokens=512, temperature=0.2)
129
  print(result[0]['generated_text'])
@@ -143,7 +156,13 @@ messages = [
143
  {"role": "system", "content": "You are a helpful coding assistant."},
144
  {"role": "user", "content": "Write a Python function to reverse a string"}
145
  ]
146
- inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
 
 
 
 
 
 
147
  outputs = model.generate(inputs, max_new_tokens=512, temperature=0.2)
148
  response = tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True)
149
  print(response)
@@ -191,12 +210,11 @@ curl -X POST "http://localhost:30000/v1/chat/completions" \
191
 
192
  ---
193
 
194
- ## πŸ’‘ Usage Examples
195
 
196
  ### πŸ‡²πŸ‡² Myanmar Prompts
197
 
198
  ```python
199
- # Code generation in Myanmar
200
  messages = [
201
  {"role": "user", "content": "Python function တစ်ခုရေးပါ။ ဂဏန်းတွေကို sorting α€œα€―α€•α€Ία€•α€±α€Έα€•α€«α‹"}
202
  ]
@@ -223,7 +241,7 @@ messages = [
223
 
224
  ---
225
 
226
- ## πŸ”— API Endpoints
227
 
228
  ### Backend Server
229
 
@@ -237,7 +255,7 @@ uvicorn app.main:app --host 0.0.0.0 --port 8000
237
  ### Endpoints
238
 
239
  | Method | Endpoint | Description |
240
- |--------|----------|-------------|
241
  | GET | `/` | Health check |
242
  | GET | `/health` | Service health status |
243
  | POST | `/chat` | Streaming chat (SSE) |
@@ -258,11 +276,7 @@ curl -X POST "http://localhost:8000/chat" \
258
  }'
259
  ```
260
 
261
- ---
262
-
263
- ## 🐳 Deployment
264
-
265
- ### Docker
266
 
267
  ```bash
268
  # Using Docker Model Runner
@@ -277,14 +291,6 @@ docker run --gpus all \
277
  --model amkyawdev/amk-coder-v2
278
  ```
279
 
280
- ### Google Colab
281
-
282
- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/amkyawdev/amk-coder-v2)
283
-
284
- ### Kaggle
285
-
286
- [![Kaggle](https://img.shields.io/badge/Kaggle-Notebook-orange)](https://www.kaggle.com)
287
-
288
  ---
289
 
290
  ## ⚠️ Limitations
@@ -301,7 +307,7 @@ docker run --gpus all \
301
 
302
  - [Qwen2.5-Coder Documentation](https://qwenlm.github.io/blog/Qwen2.5-Coder/)
303
  - [Transformers Library](https://huggingface.co/docs/transformers)
304
- - [HuggingFace Hub](https://huggingface.co/docs/hub)
305
 
306
  ---
307
 
@@ -315,7 +321,7 @@ docker run --gpus all \
315
 
316
  ## πŸ“ License
317
 
318
- Apache License 2.0 - See [LICENSE](LICENSE) file for details.
319
 
320
  ---
321
 
@@ -327,4 +333,4 @@ Apache License 2.0 - See [LICENSE](LICENSE) file for details.
327
 
328
  ---
329
 
330
- *Made with ❀️ for Myanmar Developers*
 
24
  results:
25
  - task:
26
  type: text-generation
27
+ name: CodeGeneration
28
  dataset:
29
  name: HumanEval
30
  type: openai/openai_humaneval
31
  metrics:
32
  - type: pass_at_1
33
+ value: 50
34
  verified: false
35
  - type: pass_at_10
36
+ value: 75
37
  verified: false
38
  - task:
39
  type: text-generation
40
+ name: PythonCodeGeneration
41
  dataset:
42
  name: MBPP
43
  type: abdshhayan/MBPP
44
  metrics:
45
  - type: pass_at_1
46
+ value: 55
47
  verified: false
48
  ---
49
 
50
+ # πŸ€– amk-coder-v2 β€” Myanmar Coding Agent
51
 
52
+ Myanmar Coding Assistant β€” Fine-tuned from **Qwen2.5-Coder-1.5B** using **LoRA (PEFT)**
53
 
54
+ ![Model](https://img.shields.io/badge/Model-Size-2B-blue)
55
+ ![License](https://img.shields.io/badge/License-Apache--2.0-green)
56
+ ![HuggingFace](https://img.shields.io/badge/-HuggingFace-orange)
57
 
58
  ---
59
 
60
  ## πŸ“‹ Table of Contents
61
 
62
+ - [Model Overview](#model-overview)
63
+ - [Training Details](#training-details)
64
+ - [Quick Start](#quick-start)
65
+ - [Usage Examples](#usage-examples)
66
+ - [API Deployment](#api-deployment)
67
+ - [Limitations](#limitations)
68
+ - [License](#license)
 
69
 
70
  ---
71
 
72
+ ## Model Overview
73
 
74
+ **amk-coder-v2** is a Myanmar-localized coding assistant fine-tuned from **Qwen2.5-Coder-1.5B** using LoRA (PEFT) technique.
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
  | Attribute | Value |
77
+ |---|---|
78
  | **Base Model** | Qwen2.5-Coder-1.5B |
79
  | **Parameters** | 2B (2,000M) |
80
  | **Architecture** | Qwen2ForCausalLM |
81
+ | **Training Method** | LoRA (PEFT) fine-tuning |
82
+ | **Dataset** | [amkyawdev/mm-llm-coder-agent-dataset](https://huggingface.co/datasets/amkyawdev/mm-llm-coder-agent-dataset) (4M rows) |
 
 
83
  | **Context Length** | 32,768 tokens |
84
+ | **Format** | Safetensors (BF16) |
 
85
  | **License** | Apache-2.0 |
86
+ | **Languages** | Burmese + English |
87
+
88
+ ### Features
89
+
90
+ | Feature | Description |
91
+ |---|---|
92
+ | πŸ‡²πŸ‡² **Myanmar Support** | Full support for Myanmar Unicode text |
93
+ | πŸ’» **Code Generation** | Python, JavaScript, C++, Java, and more |
94
+ | πŸ› **Debugging** | Bug detection and fixes |
95
+ | πŸ“– **Code Explanation** | Line-by-line explanations |
96
 
97
+ ---
98
+
99
+ ## Training Details
100
 
101
  | Parameter | Value |
102
+ |---|---|
103
  | **Framework** | Transformers + PEFT |
104
  | **Training Method** | LoRA fine-tuning |
105
+ | **Target Modules** | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
106
+ | **Optimizer** | paged_adamw_8bit |
107
+ | **Learning Rate** | 3e-5 |
108
  | **Epochs** | 3 |
109
  | **Batch Size** | 8 |
110
  | **Max Length** | 2048 |
111
+ | **Precision** | FP16 mixed |
112
+ | **Hardware** | Kaggle Dual T4 GPU |
113
+ | **Training Time** | ~3-5 hrs |
114
+
115
+ ### Chat Template (ChatML)
116
+
117
+ ```
118
+ <|im_start|>system
119
+ You are an expert Myanmar AI coding agent with tool access.<|im_end|>
120
+ <|im_start|>user
121
+ {Instruction}
122
+ Tools available: {Tools}<|im_end|>
123
+ <|im_start|>assistant
124
+ Thought & Code:
125
+ ```
126
 
127
  ---
128
 
129
+ ## Quick Start
130
 
131
  ### Using Transformers (Python)
132
 
 
136
 
137
  pipe = pipeline("text-generation", model="amkyawdev/amk-coder-v2")
138
  messages = [
139
+ {"role": "user", "content": "Python function တစ်ခုရေးပါ။ list comprehension α€”α€²α€· sorting α€œα€―α€•α€Ία€•α€±α€Έα€•α€«α‹"}
140
  ]
141
  result = pipe(messages, max_new_tokens=512, temperature=0.2)
142
  print(result[0]['generated_text'])
 
156
  {"role": "system", "content": "You are a helpful coding assistant."},
157
  {"role": "user", "content": "Write a Python function to reverse a string"}
158
  ]
159
+
160
+ inputs = tokenizer.apply_chat_template(
161
+ messages,
162
+ add_generation_prompt=True,
163
+ return_tensors="pt"
164
+ ).to(model.device)
165
+
166
  outputs = model.generate(inputs, max_new_tokens=512, temperature=0.2)
167
  response = tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True)
168
  print(response)
 
210
 
211
  ---
212
 
213
+ ## Usage Examples
214
 
215
  ### πŸ‡²πŸ‡² Myanmar Prompts
216
 
217
  ```python
 
218
  messages = [
219
  {"role": "user", "content": "Python function တစ်ခုရေးပါ။ ဂဏန်းတွေကို sorting α€œα€―α€•α€Ία€•α€±α€Έα€•α€«α‹"}
220
  ]
 
241
 
242
  ---
243
 
244
+ ## API Deployment
245
 
246
  ### Backend Server
247
 
 
255
  ### Endpoints
256
 
257
  | Method | Endpoint | Description |
258
+ |---|---|---|
259
  | GET | `/` | Health check |
260
  | GET | `/health` | Service health status |
261
  | POST | `/chat` | Streaming chat (SSE) |
 
276
  }'
277
  ```
278
 
279
+ ### Docker Deployment
 
 
 
 
280
 
281
  ```bash
282
  # Using Docker Model Runner
 
291
  --model amkyawdev/amk-coder-v2
292
  ```
293
 
 
 
 
 
 
 
 
 
294
  ---
295
 
296
  ## ⚠️ Limitations
 
307
 
308
  - [Qwen2.5-Coder Documentation](https://qwenlm.github.io/blog/Qwen2.5-Coder/)
309
  - [Transformers Library](https://huggingface.co/docs/transformers)
310
+ - [HuggingFace Hub](https://huggingface.co/amkyawdev/amk-coder-v2)
311
 
312
  ---
313
 
 
321
 
322
  ## πŸ“ License
323
 
324
+ Apache License 2.0 - See LICENSE file for details.
325
 
326
  ---
327
 
 
333
 
334
  ---
335
 
336
+ *Made with ❀️ for Myanmar Developers*