Laollm / README.md
Phonepadith's picture
Upload model trained with Unsloth
c7caceb verified
---
license: apache-2.0
datasets:
- Phonepadith/laos_word_dataset
language:
- lo
metrics:
- bleu
base_model:
- google/gemma-3-4b-it
pipeline_tag: summarization
library_name: fastai
tags:
- unsloth
---
# 🧠 Lao Summarization Model ສຳລັບສະຫລຸບເນື້ອຫາ - Fine-tuned Gemma 3 4B IT
This is a **Lao language summarization model** fine-tuned on the [`Phonepadith/laos_word_dataset`](https://huggingface.co/datasets/Phonepadith/laos_word_dataset), using the base model [`google/gemma-3-4b-it`](https://huggingface.co/google/gemma-3-4b-it). The model is designed to generate concise summaries from Lao language text.
---
## 📌 Model Details
- **Base Model**: [`google/gemma-3-4b-it`](https://huggingface.co/google/gemma-3-4b-it)
- **Fine-tuned by**: [Phonepadith](https://huggingface.co/Phonepadith)
- **Language**: Lao (`lo`)
- **Task**: Summarization
- **Dataset**: [`Phonepadith/laos_word_dataset`](https://huggingface.co/datasets/Phonepadith/laos_word_dataset)
- **Library**: `adapter-transformers`
- **License**: Apache 2.0
---
## 📊 Metrics
- **Evaluation Metric**: BLEU score
BLEU is used to evaluate the quality of generated summaries against reference summaries in the dataset.
---
## 🛠️ How to Use
You can load and use the model with Hugging Face Transformers and `adapter-transformers`:
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "Phonepadith/Laollm" # change to your actual model name
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
input_text = "ປັດຈຸບັນ ກອງທັບປະຊາຊົນລາວ ມີການປະກອບວັດຖຸເຕັກນິກທັນສະໄໝສົມຄວນ, ສາມາດຕອບສະໜອງ ໃຫ້ແກ່ວຽກງານປ້ອງກັນຊາດ ໃນໄລຍະໃໝ່ ໄດ້ໂດຍພື້ນຖານ; ໄດ້ປະກອບສ່ວນຢ່າງຕັ້ງໜ້າເຂົ້າໃນການປ້ອງກັນ, ຄວບຄຸມໄພພິບັດ ແລະ ຊ່ວຍເຫລືອປະຊາຊົນ ຜູ້ປະສົບໄພພິບັດທຳມະຊາດຕ່າງໆທີ່ເກີດຂຶ້ນໃນຂອບເຂດທົ່ວປະເທດ. ພ້ອມນັ້ນ, ກໍໄດ້ເປັນເຈົ້າການປະກອບສ່ວນປັບປຸງກໍ່ສ້າງພື້ນ ຖານການເມືອງ, ກໍ່ສ້າງທ່າສະໜາມສົງຄາມປະຊາຊົນ 3 ຂັ້ນ ຕິດພັນກັບວຽກງານ 3 ສ້າງ ຢູ່ທ້ອງຖິ່ນຕາມ 4 ເນື້ອໃນ 4 ຄາດໝາຍ ແລະ ສືບທອດມູນເຊື້ອຄວາມສາມັກຄີ ກັບກອງທັບປະເທດເພື່ອນມິດ ສາກົນ, ປະຕິບັດນະໂຍບາຍເພີ່ມມິດຫລຸດຜ່ອນສັດຕູ, ຮັບປະກັນສະຖຽນລະພາບ ຂອງລະບອບການ ເມືອງ, ຮັກສາຄວາມສະຫງົບປອດໄພຕາມຊາຍແດນ"
inputs = tokenizer(input_text, return_tensors="pt")
summary_ids = model.generate(**inputs, max_new_tokens=100)
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
print(summary)