Downloads Β· 30 days
6
9% of all-time downloads
amkyawdev/Myanmar-Ghost-Instruct-LoRA
Myanmar-Ghost-Instruct-LoRA is a text generation model from amkyawdev. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
Downloads Β· 30 days
6
9% of all-time downloads
All-time downloads
67
Public
Repo size
235 MB
Likes
0
Public
Click a slice to open those files.
.safetensors222 MB Β· 67%
From the Hugging Face model README
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
</div>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.
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)
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))
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"])
# 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": "ααΌααΊαα¬α
α¬αα
αΊααα―ααΊ αα±αΈαα«α"}]
}'
| 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 |
| Property | Value |
|---|---|
| Tokenizer Class | Qwen2Tokenizer |
| Model Max Length | 32,768 tokens |
| Special Tokens | `< |
| Padding Token | `< |
| 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 |
| 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 |
checkpoint-100/ - Model at step 100checkpoint-200/ - Final model at step 200This model was trained on Myanmar language instruction datasets including:
Myanmar V3 Clean Dataset (amkyawdev/myanmar-v3-clean)
AMK Coder V3 Dataset V2 (amkyawdev/amk-coder-v3-dataset-v2)
β οΈ Formal benchmark evaluation pending. The model has not been systematically evaluated on standard NLP benchmarks yet.
If you evaluate this model, consider the following benchmarks:
Myanmar NLP Tasks
General Language Tasks
Code Generation (inherited from base model)
We welcome community feedback! Please share your evaluation results and use cases in the Discussions tab.
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")
# 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"
)
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 |
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.
</div>