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)# pip install -U transformers accelerate # 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - 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 files23 unmodified lines242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181193 unmodified lines12312412512612712812913 unmodified lines14314414514614714814941 unmodified lines19119219319419519619719819920020120220 unmodified lines2232242252262272282297 unmodified lines23723823924024124224314 unmodified lines2582592602612622632642652662672688 unmodified lines27727827928028128228328428528628728828929010 unmodified lines3013023033043053063077 unmodified lines3153163173183193203215 unmodified lines32732832933023 unmodified linesresults:- task:type: text-generationname: Code Generationdataset:name: HumanEvaltype: openai/openai_humanevalmetrics:- type: pass_at_1value: 50.0verified: false- type: pass_at_10value: 75.0verified: false- task:type: text-generationname: Python Code Generationdataset:name: MBPPtype: abdshhayan/MBPPmetrics:- type: pass_at_1value: 55.0verified: false---# π€ amk-coder-v2Myanmar Coding Assistant - Fine-tuned from **Qwen2.5-Coder-1.5B**[](https://huggingface.co/amkyawdev/amk-coder-v2)[](LICENSE)[](https://huggingface.co/amkyawdev/amk-coder-v2)---## π Table of Contents- [Features](#-features)- [Model Details](#-model-details)- [Quick Start](#-quick-start)- [Usage Examples](#-usage-examples)- [API Endpoints](#-api-endpoints)- [Deployment](#-deployment)- [Limitations](#-limitations)- [License](#-license)---## β¨ Features| Feature | Description ||---------|-------------|| π²π² **Myanmar Support** | Full support for Myanmar Unicode text || π» **Code Generation** | Python, JavaScript, C++, Java, and more || π **Debugging** | Bug detection and fixes || π **Code Explanation** | Line-by-line explanations || π **Web Search** | Integration for latest documentation || π **Streaming** | Real-time response streaming || π¨ **Beautiful UI** | Modern chat interface |---## π Model Details| Attribute | Value ||-----------|-------|| **Base Model** | Qwen2.5-Coder-1.5B || **Parameters** | 2B (2,000M) || **Architecture** | Qwen2ForCausalLM || **Hidden Size** | 1536 || **Layers** | 28 || **Attention Heads** | 12 || **Vocab Size** | 151,936 || **Context Length** | 32,768 tokens || **Tensor Type** | BF16 || **Format** | Safetensors || **License** | Apache-2.0 |### Training Details| Parameter | Value ||-----------|-------|| **Framework** | Transformers + PEFT || **Training Method** | LoRA fine-tuning || **Learning Rate** | 2e-4 || **Epochs** | 3 || **Batch Size** | 8 || **Max Length** | 2048 |---## π Quick Start### Using Transformers (Python)3 unmodified linespipe = pipeline("text-generation", model="amkyawdev/amk-coder-v2")messages = [{"role": "user", "content": "Python αα²α· list comprehension αα±αΈαα«"}]result = pipe(messages, max_new_tokens=512, temperature=0.2)print(result[0]['generated_text'])13 unmodified lines{"role": "system", "content": "You are a helpful coding assistant."},{"role": "user", "content": "Write a Python function to reverse a string"}]inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)outputs = model.generate(inputs, max_new_tokens=512, temperature=0.2)response = tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True)print(response)41 unmodified lines---## π‘ Usage Examples### π²π² Myanmar Prompts```python# Code generation in Myanmarmessages = [{"role": "user", "content": "Python function αα αΊαα―αα±αΈαα«α ααααΊαΈαα½α±ααα― sorting αα―ααΊαα±αΈαα«α"}]20 unmodified lines---## π API Endpoints### Backend Server7 unmodified lines### Endpoints| Method | Endpoint | Description ||--------|----------|-------------|| GET | `/` | Health check || GET | `/health` | Service health status || POST | `/chat` | Streaming chat (SSE) |14 unmodified lines}'```---## π³ Deployment### Docker```bash# Using Docker Model Runner8 unmodified lines--model amkyawdev/amk-coder-v2```### Google Colab[](https://colab.research.google.com/github/amkyawdev/amk-coder-v2)### Kaggle[](https://www.kaggle.com)---## β οΈ Limitations10 unmodified lines- [Qwen2.5-Coder Documentation](https://qwenlm.github.io/blog/Qwen2.5-Coder/)- [Transformers Library](https://huggingface.co/docs/transformers)- [HuggingFace Hub](https://huggingface.co/docs/hub)---7 unmodified lines## π LicenseApache License 2.0 - See [LICENSE](LICENSE) file for details.---5 unmodified lines---*Made with β€οΈ for Myanmar Developers*23 unmodified lines242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311323 unmodified lines13613713813914014114213 unmodified lines15615715815916016116216316416516616716841 unmodified lines21021121221321421521621721821922020 unmodified lines2412422432442452462477 unmodified lines25525625725825926026114 unmodified lines2762772782792802812828 unmodified lines29129229329429529610 unmodified lines3073083093103113123137 unmodified lines3213223233243253263275 unmodified lines33333433533623 unmodified linesresults:- task:type: text-generationname: CodeGenerationdataset:name: HumanEvaltype: openai/openai_humanevalmetrics:- type: pass_at_1value: 50verified: false- type: pass_at_10value: 75verified: false- task:type: text-generationname: PythonCodeGenerationdataset:name: MBPPtype: abdshhayan/MBPPmetrics:- type: pass_at_1value: 55verified: false---# π€ amk-coder-v2 β Myanmar Coding AgentMyanmar Coding Assistant β Fine-tuned from **Qwen2.5-Coder-1.5B** using **LoRA (PEFT)**---## π Table of Contents- [Model Overview](#model-overview)- [Training Details](#training-details)- [Quick Start](#quick-start)- [Usage Examples](#usage-examples)- [API Deployment](#api-deployment)- [Limitations](#limitations)- [License](#license)---## Model Overview**amk-coder-v2** is a Myanmar-localized coding assistant fine-tuned from **Qwen2.5-Coder-1.5B** using LoRA (PEFT) technique.| Attribute | Value ||---|---|| **Base Model** | Qwen2.5-Coder-1.5B || **Parameters** | 2B (2,000M) || **Architecture** | Qwen2ForCausalLM || **Training Method** | LoRA (PEFT) fine-tuning || **Dataset** | [amkyawdev/mm-llm-coder-agent-dataset](https://huggingface.co/datasets/amkyawdev/mm-llm-coder-agent-dataset) (4M rows) || **Context Length** | 32,768 tokens || **Format** | Safetensors (BF16) || **License** | Apache-2.0 || **Languages** | Burmese + English |### Features| Feature | Description ||---|---|| π²π² **Myanmar Support** | Full support for Myanmar Unicode text || π» **Code Generation** | Python, JavaScript, C++, Java, and more || π **Debugging** | Bug detection and fixes || π **Code Explanation** | Line-by-line explanations |---## Training Details| Parameter | Value ||---|---|| **Framework** | Transformers + PEFT || **Training Method** | LoRA fine-tuning || **Target Modules** | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj || **Optimizer** | paged_adamw_8bit || **Learning Rate** | 3e-5 || **Epochs** | 3 || **Batch Size** | 8 || **Max Length** | 2048 || **Precision** | FP16 mixed || **Hardware** | Kaggle Dual T4 GPU || **Training Time** | ~3-5 hrs |### Chat Template (ChatML)```<|im_start|>systemYou are an expert Myanmar AI coding agent with tool access.<|im_end|><|im_start|>user{Instruction}Tools available: {Tools}<|im_end|><|im_start|>assistantThought & Code:```---## Quick Start### Using Transformers (Python)3 unmodified linespipe = pipeline("text-generation", model="amkyawdev/amk-coder-v2")messages = [{"role": "user", "content": "Python function αα αΊαα―αα±αΈαα«α list comprehension αα²α· sorting αα―ααΊαα±αΈαα«α"}]result = pipe(messages, max_new_tokens=512, temperature=0.2)print(result[0]['generated_text'])13 unmodified lines{"role": "system", "content": "You are a helpful coding assistant."},{"role": "user", "content": "Write a Python function to reverse a string"}]inputs = tokenizer.apply_chat_template(messages,add_generation_prompt=True,return_tensors="pt").to(model.device)outputs = model.generate(inputs, max_new_tokens=512, temperature=0.2)response = tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True)print(response)41 unmodified lines---## Usage Examples### π²π² Myanmar Prompts```pythonmessages = [{"role": "user", "content": "Python function αα αΊαα―αα±αΈαα«α ααααΊαΈαα½α±ααα― sorting αα―ααΊαα±αΈαα«α"}]20 unmodified lines---## API Deployment### Backend Server7 unmodified lines### Endpoints| Method | Endpoint | Description ||---|---|---|| GET | `/` | Health check || GET | `/health` | Service health status || POST | `/chat` | Streaming chat (SSE) |14 unmodified lines}'```### Docker Deployment```bash# Using Docker Model Runner8 unmodified lines--model amkyawdev/amk-coder-v2```---## β οΈ Limitations10 unmodified lines- [Qwen2.5-Coder Documentation](https://qwenlm.github.io/blog/Qwen2.5-Coder/)- [Transformers Library](https://huggingface.co/docs/transformers)- [HuggingFace Hub](https://huggingface.co/amkyawdev/amk-coder-v2)---7 unmodified lines## π LicenseApache License 2.0 - See LICENSE file for details.---5 unmodified lines---*Made with β€οΈ for Myanmar Developers*
README.md+71-65