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)
1 from peft import PeftModel
2 from transformers import AutoModelForCausalLM , AutoTokenizer
3 import torch
4
5 # Load base model and tokenizer
6 base_model = AutoModelForCausalLM . from_pretrained (
7 "Qwen/Qwen2.5-Coder-1.5B-Instruct" ,
8 device_map = "auto" ,
9 torch_dtype = torch . float16 ,
10 trust_remote_code = True
11 )
12
13 tokenizer = AutoTokenizer . from_pretrained (
14 "Qwen/Qwen2.5-Coder-1.5B-Instruct" ,
15 trust_remote_code = True
16 )
17
18 # Load LoRA adapter
19 model = PeftModel . from_pretrained (
20 base_model ,
21 "amkyawdev/Myanmar-Ghost-Instruct-LoRA"
22 )
23
24 # Generate text
25 messages = [
26 { "role" : "user" , "content" : "မြန်မာစာတစ်ပိုဒ် ရေးပါ။" }
27 ]
28 text = tokenizer . apply_chat_template ( messages , tokenize = False , add_generation_prompt = True )
29 inputs = tokenizer ( [ text ] , return_tensors = "pt" ) . to ( model . device )
30
31 outputs = model . generate (
32 ** inputs ,
33 max_new_tokens = 512 ,
34 temperature = 0.7 ,
35 top_p = 0.9
36 )
37 print ( tokenizer . decode ( outputs [ 0 ] , skip_special_tokens = True ) )
1 from transformers import pipeline
2
3 pipe = pipeline (
4 "text-generation" ,
5 model = "amkyawdev/Myanmar-Ghost-Instruct-LoRA" ,
6 model_kwargs = { "device_map" : "auto" , "torch_dtype" : "float16" }
7 )
8
9 messages = [
10 { "role" : "user" , "content" : "မြန်မာစာတစ်ပိုဒ် ရေးပါ။" }
11 ]
12 output = pipe ( messages , max_new_tokens = 512 , temperature = 0.7 )
13 print ( output [ 0 ] [ "generated_text" ] )
1 # Install vLLM
2 pip install vllm
3
4 # Start server
5 vllm serve "amkyawdev/Myanmar-Ghost-Instruct-LoRA" --dtype float16
6
7 # API call
8 curl -X POST "http://localhost:8000/v1/chat/completions" \
9 -H "Content-Type: application/json" \
10 --data '{
11 "model": "amkyawdev/Myanmar-Ghost-Instruct-LoRA",
12 "messages": [{"role": "user", "content": "မြန်မာစာတစ်ပိုဒ် ရေးပါ။"}]
13 }'
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)
We welcome community feedback! Please share your evaluation results and use cases in the
Discussions tab.
1 from peft import PeftModel
2 from transformers import AutoModelForCausalLM
3 import torch
4
5 base_model = AutoModelForCausalLM . from_pretrained (
6 "Qwen/Qwen2.5-Coder-1.5B-Instruct" ,
7 device_map = "cpu" ,
8 torch_dtype = torch . float32 ,
9 )
10 model = PeftModel . from_pretrained ( base_model , "amkyawdev/Myanmar-Ghost-Instruct-LoRA" )
11
12 # Merge adapter weights
13 merged_model = model . merge_and_unload ( )
14 merged_model . save_pretrained ( "merged-model" )
1 # 4-bit quantization with GGUF
2 from transformers import AutoModelForCausalLM , BitsAndBytesConfig
3
4 quantization_config = BitsAndBytesConfig (
5 load_in_4bit = True ,
6 bnb_4bit_use_double_quant = True ,
7 bnb_4bit_quant_type = "nf4" ,
8 bnb_4bit_compute_dtype = torch . float16
9 )
10
11 model = AutoModelForCausalLM . from_pretrained (
12 "amkyawdev/Myanmar-Ghost-Instruct-LoRA" ,
13 quantization_config = quantization_config ,
14 device_map = "auto"
15 )
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.