Instructions to use amkyawdev/Myanmar-Ghost-Instruct-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use amkyawdev/Myanmar-Ghost-Instruct-LoRA with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct") model = PeftModel.from_pretrained(base_model, "amkyawdev/Myanmar-Ghost-Instruct-LoRA") - Transformers
How to use amkyawdev/Myanmar-Ghost-Instruct-LoRA with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="amkyawdev/Myanmar-Ghost-Instruct-LoRA") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("amkyawdev/Myanmar-Ghost-Instruct-LoRA", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use amkyawdev/Myanmar-Ghost-Instruct-LoRA with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "amkyawdev/Myanmar-Ghost-Instruct-LoRA" # 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/Myanmar-Ghost-Instruct-LoRA", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/amkyawdev/Myanmar-Ghost-Instruct-LoRA
- SGLang
How to use amkyawdev/Myanmar-Ghost-Instruct-LoRA 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/Myanmar-Ghost-Instruct-LoRA" \ --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/Myanmar-Ghost-Instruct-LoRA", "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/Myanmar-Ghost-Instruct-LoRA" \ --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/Myanmar-Ghost-Instruct-LoRA", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use amkyawdev/Myanmar-Ghost-Instruct-LoRA with Docker Model Runner:
docker model run hf.co/amkyawdev/Myanmar-Ghost-Instruct-LoRA
π²π² Myanmar-Ghost-Instruct-LoRA
Myanmar Language Instruction-Tuned LLM based on Qwen2.5-Coder-1.5B-Instruct
A lightweight LoRA adapter for Myanmar language text generation and instruction following
π Model Overview
Myanmar-Ghost-Instruct-LoRA is a LoRA (Low-Rank Adaptation) adapter trained on Qwen/Qwen2.5-Coder-1.5B-Instruct to enhance Myanmar (Burmese) language understanding and generation capabilities.
Key Features
- π Lightweight: Only ~74MB (LoRA adapter)
- π²π² Myanmar-First: Optimized for Burmese text generation
- π» Code Capable: Base model retains code generation abilities
- β‘ Fast Inference: Low-rank adaptation for efficient deployment
- π§ Easy Integration: Compatible with PEFT and Transformers libraries
Model Tree
Qwen/Qwen2.5-1.5B
βββ Qwen/Qwen2.5-Coder-1.5B
βββ Qwen/Qwen2.5-Coder-1.5B-Instruct
βββ amkyawdev/Myanmar-Ghost-Instruct-LoRA β
(this model)
π Quick Start
Using PEFT (Recommended)
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# Load base model and tokenizer
base_model = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen2.5-Coder-1.5B-Instruct",
device_map="auto",
torch_dtype=torch.float16,
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(
"Qwen/Qwen2.5-Coder-1.5B-Instruct",
trust_remote_code=True
)
# Load LoRA adapter
model = PeftModel.from_pretrained(
base_model,
"amkyawdev/Myanmar-Ghost-Instruct-LoRA"
)
# Generate text
messages = [
{"role": "user", "content": "ααΌααΊαα¬α
α¬αα
αΊααα―ααΊ αα±αΈαα«α"}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.7,
top_p=0.9
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Using Transformers Pipeline
from transformers import pipeline
pipe = pipeline(
"text-generation",
model="amkyawdev/Myanmar-Ghost-Instruct-LoRA",
model_kwargs={"device_map": "auto", "torch_dtype": "float16"}
)
messages = [
{"role": "user", "content": "ααΌααΊαα¬α
α¬αα
αΊααα―ααΊ αα±αΈαα«α"}
]
output = pipe(messages, max_new_tokens=512, temperature=0.7)
print(output[0]["generated_text"])
Using vLLM
# Install vLLM
pip install vllm
# Start server
vllm serve "amkyawdev/Myanmar-Ghost-Instruct-LoRA" --dtype float16
# API call
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "amkyawdev/Myanmar-Ghost-Instruct-LoRA",
"messages": [{"role": "user", "content": "ααΌααΊαα¬α
α¬αα
αΊααα―ααΊ αα±αΈαα«α"}]
}'
π Technical Specifications
LoRA Configuration
| Parameter | Value |
|---|---|
| PEFT Type | LORA |
| Rank (r) | 16 |
| Alpha | 32 |
| Dropout | 0.05 |
| Target Modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Bias | none |
| Task Type | CAUSAL_LM |
Tokenizer
| Property | Value |
|---|---|
| Tokenizer Class | Qwen2Tokenizer |
| Model Max Length | 32,768 tokens |
| Special Tokens | `< |
| Padding Token | `< |
Adapter File Size
- adapter_model.safetensors: ~74 MB
- Total model size (with base): ~3-4 GB
ποΈ Training Details
Training Hyperparameters
| Parameter | Value |
|---|---|
| Total Steps | 200 |
| Save Steps | 100 |
| Batch Size | 1 |
| Max Steps per Epoch | 12,500 (estimated) |
| Training Epochs | 1 |
| Max Learning Rate | 2e-4 (warmup) |
| Final Learning Rate | ~5.2e-8 |
| Training Framework | PEFT 0.19.1 |
| Base Model | Qwen2.5-Coder-1.5B-Instruct |
Training Progress
| Step | Loss | Learning Rate | Grad Norm |
|---|---|---|---|
| 1 | 12.01 | 0.0 | 6.93 |
| 50 | ~2.5 | ~1e-4 | ~3.0 |
| 100 | ~1.5 | ~5e-5 | ~2.5 |
| 200 (final) | 1.91 | 5.2e-8 | 2.66 |
Available Checkpoints
checkpoint-100/- Model at step 100checkpoint-200/- Final model at step 200
π Training Data
This model was trained on Myanmar language instruction datasets including:
Myanmar V3 Clean Dataset (amkyawdev/myanmar-v3-clean)
- ~878K samples
- Cleaned and quality-filtered Myanmar text
AMK Coder V3 Dataset V2 (amkyawdev/amk-coder-v3-dataset-v2)
- ~1.01M samples
- Code and natural language instruction pairs
π― Intended Uses
Direct Use Cases
- β Myanmar language text generation
- β Burmese language conversation
- β Translation assistance (Myanmar β other languages)
- β Text summarization in Burmese
- β Code generation assistance (preserved from base model)
Downstream Use Cases
- π§ Fine-tuning for specific Myanmar NLP tasks
- π§ Domain-specific applications (healthcare, legal, education)
- π§ Chatbot development for Burmese speakers
- π§ Research on low-resource language LLMs
Out-of-Scope Uses
- β οΈ Medical or legal advice without human verification
- β οΈ High-stakes decision-making systems
- β οΈ Production systems without thorough evaluation
- β οΈ Generating harmful or misleading content
β οΈ Bias, Risks, and Limitations
Technical Limitations
- Model Size: 1.5B parameters may limit performance on complex tasks
- Training Steps: Limited training (200 steps) may affect instruction-following quality
- Token Limit: 32,768 context window
- Resource Requirements: GPU recommended for inference
Sociotechnical Considerations
- Language Coverage: Optimized primarily for Burmese; may vary for regional dialects
- Cultural Bias: Training data may reflect specific cultural perspectives
- Safety: As with any LLM, outputs should be verified before critical use
Recommendations
- Evaluate on your specific use case before production deployment
- Implement appropriate content filtering
- Provide human oversight for sensitive applications
- Consider fine-tuning for domain-specific tasks
π Evaluation
Evaluation Status
β οΈ Formal benchmark evaluation pending. The model has not been systematically evaluated on standard NLP benchmarks yet.
Recommended Evaluation Tasks
If you evaluate this model, consider the following benchmarks:
Myanmar NLP Tasks
- Myanmar text classification
- Sentiment analysis (Burmese)
- Named entity recognition
General Language Tasks
- MMLU (Multilingual Massive Multitask)
- Hellaswag
- TruthfulQA
Code Generation (inherited from base model)
- HumanEval
- MBPP
User Feedback
We welcome community feedback! Please share your evaluation results and use cases in the Discussions tab.
π§ Merge and Deploy
Merge LoRA with Base Model
from peft import PeftModel
from transformers import AutoModelForCausalLM
import torch
base_model = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen2.5-Coder-1.5B-Instruct",
device_map="cpu",
torch_dtype=torch.float32,
)
model = PeftModel.from_pretrained(base_model, "amkyawdev/Myanmar-Ghost-Instruct-LoRA")
# Merge adapter weights
merged_model = model.merge_and_unload()
merged_model.save_pretrained("merged-model")
Quantization for Deployment
# 4-bit quantization with GGUF
from transformers import AutoModelForCausalLM, BitsAndBytesConfig
quantization_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16
)
model = AutoModelForCausalLM.from_pretrained(
"amkyawdev/Myanmar-Ghost-Instruct-LoRA",
quantization_config=quantization_config,
device_map="auto"
)
π Related Models
Explore more models from the author:
| Model | Description |
|---|---|
| Myanmar-Ghost-Instruct-GGUF | GGUF format for local inference |
| myanmar-ai-v3 | Full model version |
| qwen2.5-myanmar-ai-adapter | Alternative adapter |
| amk-coder-v2 | Coding-focused model |
π Contact & Support
- Author: Aung Myo Kyaw (amkyawdev)
- Website: amkyaw-ai.vercel.app
- GitHub: github.com/AmkyawDev
- Demo: Myanmar AI V3 Demo
Framework Versions
- PEFT: 0.19.1
- Transformers: Compatible with latest version
- PyTorch: Recommended 2.0+
π License
This adapter is released under the Apache 2.0 License.
The base model Qwen/Qwen2.5-Coder-1.5B-Instruct is licensed by Alibaba Cloud and subject to its terms.
Made with β€οΈ for the Myanmar AI community
This model card was created to improve transparency and reproducibility.
- Downloads last month
- 51
Model tree for amkyawdev/Myanmar-Ghost-Instruct-LoRA
Base model
Qwen/Qwen2.5-1.5B
docker model run hf.co/amkyawdev/Myanmar-Ghost-Instruct-LoRA