Text Generation
Transformers
Safetensors
qwen2
code-generation
myanmar
burmese
qwen
qwen2.5
qwen2.5-coder
conversational
Eval Results (legacy)
text-generation-inference
Instructions to use amkyawdev/amk-coder-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amkyawdev/amk-coder-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="amkyawdev/amk-coder-v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("amkyawdev/amk-coder-v2") model = AutoModelForCausalLM.from_pretrained("amkyawdev/amk-coder-v2", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use amkyawdev/amk-coder-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "amkyawdev/amk-coder-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amkyawdev/amk-coder-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/amkyawdev/amk-coder-v2
- SGLang
How to use amkyawdev/amk-coder-v2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "amkyawdev/amk-coder-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amkyawdev/amk-coder-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "amkyawdev/amk-coder-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amkyawdev/amk-coder-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use amkyawdev/amk-coder-v2 with Docker Model Runner:
docker model run hf.co/amkyawdev/amk-coder-v2
Update README.md: add training details, fix AutoModelForCausalLM, update model overview
Browse files
README.md
CHANGED
|
@@ -24,96 +24,109 @@ model-index:
|
|
| 24 |
results:
|
| 25 |
- task:
|
| 26 |
type: text-generation
|
| 27 |
-
name:
|
| 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:
|
| 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
|
| 51 |
|
| 52 |
-
Myanmar Coding Assistant
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
|
| 58 |
---
|
| 59 |
|
| 60 |
## π Table of Contents
|
| 61 |
|
| 62 |
-
- [
|
| 63 |
-
- [
|
| 64 |
-
- [Quick Start](#
|
| 65 |
-
- [Usage Examples](#
|
| 66 |
-
- [API
|
| 67 |
-
- [
|
| 68 |
-
- [
|
| 69 |
-
- [License](#-license)
|
| 70 |
|
| 71 |
---
|
| 72 |
|
| 73 |
-
##
|
| 74 |
|
| 75 |
-
|
| 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 |
-
| **
|
| 95 |
-
| **
|
| 96 |
-
| **Attention Heads** | 12 |
|
| 97 |
-
| **Vocab Size** | 151,936 |
|
| 98 |
| **Context Length** | 32,768 tokens |
|
| 99 |
-
| **
|
| 100 |
-
| **Format** | Safetensors |
|
| 101 |
| **License** | Apache-2.0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
|
| 103 |
-
|
|
|
|
|
|
|
| 104 |
|
| 105 |
| Parameter | Value |
|
| 106 |
-
|---
|
| 107 |
| **Framework** | Transformers + PEFT |
|
| 108 |
| **Training Method** | LoRA fine-tuning |
|
| 109 |
-
| **
|
|
|
|
|
|
|
| 110 |
| **Epochs** | 3 |
|
| 111 |
| **Batch Size** | 8 |
|
| 112 |
| **Max Length** | 2048 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
---
|
| 115 |
|
| 116 |
-
##
|
| 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
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
-
##
|
| 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 |
-
##
|
| 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 |
-
[](https://colab.research.google.com/github/amkyawdev/amk-coder-v2)
|
| 283 |
-
|
| 284 |
-
### Kaggle
|
| 285 |
-
|
| 286 |
-
[](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/
|
| 305 |
|
| 306 |
---
|
| 307 |
|
|
@@ -315,7 +321,7 @@ docker run --gpus all \
|
|
| 315 |
|
| 316 |
## π License
|
| 317 |
|
| 318 |
-
Apache License 2.0 - See
|
| 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 |
+

|
| 55 |
+

|
| 56 |
+

|
| 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*
|