初始化项目,由ModelHub XC社区提供模型
Model: URajinda/Qwen-1.5B-Burmese-SFT-v2 Source: Original Platform
This commit is contained in:
63
README.md
Normal file
63
README.md
Normal file
@@ -0,0 +1,63 @@
|
||||
---
|
||||
# ဤအပေါ်ဆုံး အပိုင်းကို Hugging Face မှ Metadata အတွက် သုံးပါသည်
|
||||
library_name: transformers
|
||||
tags:
|
||||
- myanmar
|
||||
- burmese
|
||||
- instruction-tuned
|
||||
- qlora
|
||||
- qwen
|
||||
- qwen-1.5
|
||||
- llm
|
||||
language: "my"
|
||||
license: apache-2.0
|
||||
model_name: "Qwen-1.5B-Burmese-SFT-v2"
|
||||
model_creator: "URajinda"
|
||||
base_model: "Qwen/Qwen-1.5-1.8B"
|
||||
---
|
||||
|
||||
# 🚀 URajinda/Qwen-1.5B-Burmese-SFT-v2 (မြန်မာစာ Fine-Tuned LLM)
|
||||
|
||||
ဤသည်မှာ **Alibaba Cloud မှ Qwen-1.5-1.8B** အခြေခံမော်ဒယ်ကို မြန်မာဘာသာစကားဖြင့် **Instruction-Tuning (SFT)** ထပ်မံပြုလုပ်ထားသော ဘာသာစကားမော်ဒယ် (LLM) ဖြစ်ပါသည်။ ၎င်းကို မြန်မာစာဖြင့် မေးခွန်းဖြေဆိုခြင်း (QA) နှင့် ညွှန်ကြားချက်များ လိုက်နာခြင်း (Instruction Following) တို့အတွက် အထူးကောင်းမွန်စေရန် လေ့ကျင့်ထားပါသည်။
|
||||
|
||||
## 💡 အသုံးပြုပုံ (How to Use)
|
||||
|
||||
ဤမော်ဒယ်သည် စကားပြောဆိုမှု (Chat) ပုံစံဖြင့် လေ့ကျင့်ထားသောကြောင့်၊ `User:` နှင့် `Assistant:` tags များကို အသုံးပြုပြီး မေးမြန်းရပါမည်။
|
||||
|
||||
### 🐍 Hugging Face Pipeline ဖြင့် စမ်းသပ်ခြင်း
|
||||
|
||||
```python
|
||||
import torch
|
||||
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
|
||||
|
||||
model_id = "URajinda/Qwen-1.5B-Burmese-SFT-v2"
|
||||
|
||||
# 1. Tokenizer နှင့် Model ကို load လုပ်ခြင်း
|
||||
# Note: torch_dtype အစား dtype ကို သုံးပါ
|
||||
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
||||
model = AutoModelForCausalLM.from_pretrained(
|
||||
model_id,
|
||||
dtype=torch.float16,
|
||||
device_map="auto"
|
||||
)
|
||||
|
||||
# 2. Inference Pipeline ကို တည်ဆောက်ခြင်း
|
||||
generator = pipeline(
|
||||
"text-generation",
|
||||
model=model,
|
||||
tokenizer=tokenizer,
|
||||
device=model.device
|
||||
)
|
||||
|
||||
# 3. မြန်မာဘာသာဖြင့် မေးမြန်းခြင်း (Instruction Format ကို သုံးပါ)
|
||||
prompt = "User: မန္တလေးမြို့ရဲ့ အထင်ကရနေရာ သုံးခုကို ဖော်ပြပေးပါ။\nAssistant:"
|
||||
|
||||
output = generator(
|
||||
prompt,
|
||||
max_new_tokens=256,
|
||||
do_sample=True,
|
||||
temperature=0.7,
|
||||
eos_token_id=tokenizer.eos_token_id
|
||||
)
|
||||
|
||||
print(output[0]['generated_text'])
|
||||
Reference in New Issue
Block a user