amkyawdev commited on
Commit
5815d0c
·
verified ·
1 Parent(s): 2fc8ea6

Add YAML metadata for model card

Browse files
Files changed (1) hide show
  1. README.md +45 -232
README.md CHANGED
@@ -1,238 +1,51 @@
1
- # Model Card: amk-coder-v2
2
-
3
- ## Model Details
4
- - **Developed by:** amkyawdev
5
- - **Model type:** Language Model (LLM) - Code Generation
6
- - **Language(s):** Myanmar (my), English (en)
7
- - **License:** Apache-2.0
8
- - **Base Model:** Qwen/Qwen2.5-Coder-1.5B
9
- - **Model Size:** 2B parameters
10
- - **Released:** 2025
11
-
12
- ## Model Description
13
- Myanmar-localized coding agent model fine-tuned from Qwen/Qwen2.5-Coder-1.5B using LoRA (PEFT). Designed for code generation and coding assistance in Myanmar language context.
14
-
15
- ## Model Sources
16
- - **Repository:** [amkyawdev/amk-coder-v2](https://huggingface.co/amkyawdev/amk-coder-v2)
17
- - **Dataset:** [amkyawdev/mm-llm-coder-agent-dataset](https://huggingface.co/datasets/amkyawdev/mm-llm-coder-agent-dataset)
18
- - **Space Demo:** [amkyawdev/amkyawdev-amk-coder-v2](https://huggingface.co/spaces/amkyawdev/amkyawdev-amk-coder-v2)
19
-
20
- ## Model Configuration
21
- | Parameter | Value |
22
- | --- | --- |
23
- | Base Model | Qwen/Qwen2.5-Coder-1.5B |
24
- | Fine-tuning Method | LoRA (PEFT) |
25
- | Target Modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
26
- | LoRA Rank (r) | 16 |
27
- | LoRA Alpha | 32 |
28
- | LoRA Dropout | 0.05 |
29
- | Optimizer | paged_adamw_8bit |
30
- | Precision | FP16 Mixed Precision |
31
- | Learning Rate | 3e-5 |
32
- | Weight Decay | 0.01 |
33
- | Warmup Ratio | 0.03 |
34
- | Hardware | Kaggle Cloud (Dual NVIDIA T4 GPUs) |
35
-
36
- ## Training Details
37
- | Parameter | Value |
38
- | --- | --- |
39
- | Precision | FP16 Mixed Precision |
40
- | Optimizer | paged_adamw_8bit |
41
- | Learning Rate | 3e-5 |
42
- | Epochs | 3 |
43
- | Batch Size | 4 per device |
44
- | Gradient Accumulation | 4 steps |
45
- | Max Seq Length | 2048 |
46
- | Training Steps | ~2,500 |
47
- | Warmup Steps | ~75 |
48
- | Hardware | Kaggle (Dual NVIDIA T4 GPUs) |
49
- | Training Time | ~4 hours |
50
-
51
- ## Training Metrics
52
- | Metric | Value |
53
- | --- | --- |
54
- | Final Training Loss | 0.89 |
55
- | Final Validation Loss | 0.94 |
56
- | Learning Rate (final) | 2.1e-6 |
57
-
58
- ## Code Generation Examples
59
-
60
- ### Example 1: Simple Function (Myanmar Prompt)
61
- **Input:**
62
- ```
63
- <|im_start|>system
64
- You are an expert Myanmar AI coding agent with tool access.<|im_end|>
65
- <|im_start|>user
66
- Python ဖြင့် list ထဲက largest number ကို ရှာတဲ့ function ရေးပါ<|im_end|>
67
- <|im_start|>assistant
68
- Thought & Code:
69
- ```
70
-
71
- **Output:**
72
- ```python
73
- def find_largest(numbers):
74
- """List ထဲက အကြီးဆုံးနံပါတ်ကို ရှာပါ"""
75
- if not numbers:
76
- return None
77
- return max(numbers)
78
-
79
- # Example
80
- numbers = [10, 25, 5, 42, 17]
81
- print(find_largest(numbers)) # Output: 42
82
- ```
83
-
84
- ### Example 2: Class Definition (English Prompt)
85
- **Input:**
86
- ```
87
- <|im_start|>system
88
- You are an expert Myanmar AI coding agent with tool access.<|im_end|>
89
- <|im_start|>user
90
- Write a Python class for a Bank Account with deposit and withdrawal methods<|im_end|>
91
- <|im_start|>assistant
92
- Thought & Code:
93
- ```
94
-
95
- **Output:**
96
- ```python
97
- class BankAccount:
98
- def __init__(self, account_holder, initial_balance=0):
99
- self.account_holder = account_holder
100
- self.balance = initial_balance
101
-
102
- def deposit(self, amount):
103
- if amount > 0:
104
- self.balance += amount
105
- return f"Deposited {amount}. New balance: {self.balance}"
106
- return "Invalid deposit amount"
107
-
108
- def withdraw(self, amount):
109
- if amount > self.balance:
110
- return "Insufficient funds"
111
- self.balance -= amount
112
- return f"Withdrew {amount}. New balance: {self.balance}"
113
-
114
- # Example
115
- account = BankAccount("Kyaw", 1000)
116
- print(account.deposit(500)) # Deposited 500. New balance: 1500
117
- print(account.withdraw(300)) # Withdrew 300. New balance: 1200
118
- ```
119
-
120
- ### Example 3: Myanmar Code Comment
121
- **Input:**
122
- ```
123
- <|im_start|>system
124
- You are an expert Myanmar AI coding agent with tool access.<|im_end|>
125
- <|im_start|>user
126
- Fibonacci sequence generator ရေးပါ။ တွက်ချက်ပုံကို myanmar နဲ့ comment ရေးပါ<|im_end|>
127
- <|im_start|>assistant
128
- Thought & Code:
129
- ```
130
-
131
- **Output:**
132
- ```python
133
- def fibonacci(n):
134
- """
135
- Fibonacci sequence generator
136
- - F(0) = 0
137
- - F(1) = 1
138
- - F(n) = F(n-1) + F(n-2)
139
- """
140
- a, b = 0, 1
141
- for _ in range(n):
142
- yield a # လက်ရှိတန်ဖိုးကို ထုတ်ပေးမယ်
143
- a, b = b, a + b # နောက်တန်ဖိုးသစ်ကို တွက်ချက်မယ်
144
-
145
- # Example
146
- print(list(fibonacci(10))) # [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
147
- ```
148
-
149
- ## How to Get Started
150
-
151
- ### Using Transformers
152
- ```python
153
- from transformers import AutoModelForCausalLM, AutoTokenizer
154
-
155
- model_name = "amkyawdev/amk-coder-v2"
156
- tokenizer = AutoTokenizer.from_pretrained(model_name)
157
- model = AutoModelForCausalLM.from_pretrained(model_name)
158
-
159
- # Myanmar prompt
160
- prompt = """<|im_start|>system
161
- You are an expert Myanmar AI coding agent with tool access.<|im_end|>
162
- <|im_start|>user
163
- Python ဖြင့် hello world print လုပ်ပါ<|im_end|>
164
- <|im_start|>assistant
165
- Thought & Code:"""
166
-
167
- inputs = tokenizer(prompt, return_tensors="pt")
168
- outputs = model.generate(
169
- **inputs,
170
- max_new_tokens=256,
171
- temperature=0.2,
172
- do_sample=True
173
- )
174
- print(tokenizer.decode(outputs[0], skip_special_tokens=True))
175
  ```
176
 
177
- ### Using vLLM (Production)
178
  ```bash
179
- vllm serve "amkyawdev/amk-coder-v2"
 
180
  ```
181
 
182
- ## Uses
183
-
184
- ### Direct Use
185
- - Code generation with Myanmar language instructions
186
- - Building Myanmar-speaking coding assistants
187
- - Code translation (English ↔ Myanmar)
188
- - Educational code examples in Myanmar
189
-
190
- ### Out-of-Scope Use
191
- - ⚠️ Not for production deployment without testing
192
- - ⚠️ Not for safety-critical applications
193
- - ⚠️ Not for generating malicious code
194
- - ⚠️ Always verify generated code before execution
195
-
196
- ## Safety Evaluation
197
-
198
- ### Harmful Code Detection
199
- | Test Category | Result | Notes |
200
- | --- | --- | --- |
201
- | Malware Generation | ✅ Blocked | Model refuses malicious requests |
202
- | Exploit Code | ⚠️ Partial | Some basic exploits may be generated |
203
- | Injection Attacks | ✅ Blocked | SQL, XSS injection blocked |
204
- | PII Extraction | ✅ Blocked | No PII extraction capability |
205
-
206
- ### Limitations
207
- - May generate syntactically incorrect code
208
- - Myanmar language support may be inconsistent
209
- - Complex algorithms may contain errors
210
- - Always review code before use
211
-
212
- ## Bias, Risks, and Limitations
213
- - Model may generate incorrect or insecure code
214
- - Myanmar language quality varies
215
- - Training data quality affects outputs
216
- - Not suitable for critical infrastructure code
217
-
218
- ## Environmental Impact
219
- - **Hardware Type:** NVIDIA T4 GPUs (Dual)
220
- - **Cloud Provider:** Kaggle
221
- - **Training Time:** ~4 hours
222
- - **Carbon Footprint:** ~0.2 kg CO2e (estimated)
223
-
224
- ## Citation
225
- ```bibtex
226
- @misc{amk-coder-v2,
227
- author = {amkyawdev},
228
- title = {amk-coder-v2: Myanmar Coding Agent Model},
229
- year = {2025},
230
- publisher = {HuggingFace},
231
- url = {https://huggingface.co/amkyawdev/amk-coder-v2}
232
- }
233
- ```
234
 
235
- ## Acknowledgments
236
- - Base Model: [Qwen/Qwen2.5-Coder-1.5B](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B)
237
- - Training Framework: [Unsloth](https://github.com/unslothai/unsloth), Hugging Face TRL
238
- - Dataset: [amkyawdev/mm-llm-coder-agent-dataset](https://huggingface.co/datasets/amkyawdev/mm-llm-coder-agent-dataset)
 
1
+ ---
2
+ pipeline_tag: text-generation
3
+ license: apache-2.0
4
+ tags:
5
+ - code-generation
6
+ - myanmar
7
+ - burmese
8
+ - qwen
9
+ - conversational
10
+ - transformers
11
+ library_name: transformers
12
+ inference:
13
+ parameters:
14
+ max_new_tokens: 512
15
+ temperature: 0.2
16
+ ---
17
+
18
+ # 🤖 amk-coder-agent
19
+
20
+ Myanmar Coding Agent using **amk-coder-v2** (fine-tuned from Qwen2.5-Coder-1.5B)
21
+
22
+ ## Features
23
+ - 🇲🇲 Myanmar & English language support
24
+ - 💻 Code generation, debugging, explanation
25
+ - 🔍 Web search integration
26
+ - 🌐 Streaming responses
27
+ - 🎨 Beautiful chat UI
28
+
29
+ ## Quick Start
30
+
31
+ ### Backend
32
+ ```bash
33
+ cd backend
34
+ pip install -r requirements.txt
35
+ export HF_TOKEN=hf_your_token
36
+ uvicorn app.main:app --host 0.0.0.0 --port 8000
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  ```
38
 
39
+ ### CLI
40
  ```bash
41
+ cd cli
42
+ python bot.py
43
  ```
44
 
45
+ ## API Endpoints
46
+ - `GET /` - Health check
47
+ - `POST /chat` - Streaming chat (SSE)
48
+ - `GET /demo` - Demo HTML interface
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
+ ## License
51
+ Apache-2.0