Myanmar GPT is a model trained on a private Myanmar language dataset made by MinSiThu.
The project aims to make the Myanmar language available in the GPT2 Model.
Fine-tuning the MyanmarGPT model makes it easier to build a custom Myanmar language model than using alternative language models.
Reports on training the MyanmarGPT model are visualized at
MyanmarGPT Report.
Variants of the Burmese Language-Enabled Models can be found at
https://github.com/MinSiThu/MyanmarGPT.
There is also 1.42 billion parameters MyanmarGPT-Big model with multilanguage support.
You are find
MyanmarGPT-Big Here.
Currently, Myanmar GPT has four main variant versions.
1from transformers import pipeline
2
3generator = pipeline(model="jojo-ai-mst/MyanmarGPT")
4outputs = generator("အီတလီ",do_sample=False)
5
6print(outputs)
7# [{'generated_text': 'အီတလီနိုင်ငံသည် ဥရောပတိုက်၏ တောင်ဘက်တွင် မြေထဲပင်လယ်ထဲသို့ ထိုးထွက်နေသော ကျွန်းဆွယ်ကြီးတစ်ခုဖြစ်၍ ပုံသဏ္ဌာန်အားဖြင့် မြင်းစီးဖိနပ်နှင့် တူလေသည်။ မြောက်ဘက်မှ တောင်ဘက်အငူစွန်းအထိ မိုင်ပေါင်း ၇၅ဝ ခန့် ရှည်လျား၍၊ ပျမ်းမျှမိုင် ၁ဝဝ မှ ၁၂ဝ ခန့်ကျယ်သည်။ အီတလီနိုင်ငံ၏ အကျယ်အဝန်းမှာ ဆာဒင်းနီးယားကျွန်း၊ စစ္စလီကျွန်းနှင့် အနီးပတ်ဝန်းကျင်ရှိ ကျွန်းကလေးများ အပါအဝင် ၁၁၆,၃၅၀ စတုရန်းမိုင်ရှိသည်။ '}]
1import torch
2from transformers import GPT2Tokenizer, GPT2LMHeadModel
3
4model = GPT2LMHeadModel.from_pretrained("jojo-ai-mst/MyanmarGPT")
5tokenizer = GPT2Tokenizer.from_pretrained("jojo-ai-mst/MyanmarGPT")
6
7def generate_text(prompt, max_length=300, temperature=0.8, top_k=50):
8 input_ids = tokenizer.encode(prompt, return_tensors="pt").cuda() # remove .cude() if only cpu
9 output = model.generate(
10 input_ids,
11 max_length=max_length,
12 temperature=temperature,
13 top_k=top_k,
14 pad_token_id=tokenizer.eos_token_id,
15 do_sample=True
16 )
17 for result in output:
18 generated_text = tokenizer.decode(result, skip_special_tokens=True)
19 print(generated_text)
20
21generate_text("အီတလီ ")
I started MyanmarGPT, it has had a huge impact on Myanmar, thus I continue to move this project as a movement called
MyanmarGPT Movement.
MyanmarGPT Movement is for everyone to initiate AI projects in Myanmar.
-
MyanmarGPT is free to use for everyone,
-
Must Do
- any project derived/finetuned from MyanmarGPT, used MyanmarGPT internally,
- or modified MyanmarGPT, related to MyanmarGPT must mention the citation below in the corresponding project's page.
-
the citation
1@software{MyanmarGPT,
2 author = {{MinSiThu}},
3 title = {MyanmarGPT},
4 version={1.1-SweptWood}
5 url = {https://huggingface.co/jojo-ai-mst/MyanmarGPT},
6 urldate = {2023-12-14}
7 date = {2023-12-14},
8}