Downloads · 30 days
7
21% of all-time downloads
jenniemoonsunset123/khmer-rag-model
khmer-rag-model is a text generation model from jenniemoonsunset123. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as mit.
This is a fine-tuned adapter model for Khmer language tasks using Retrieval-Augmented Generation (RAG).
Downloads · 30 days
7
21% of all-time downloads
All-time downloads
34
Public
Repo size
185 MB
Likes
0
Public
Click a slice to open those files.
.safetensors168 MB · 91%
From the Hugging Face model README
This is a fine-tuned adapter model for Khmer language tasks using Retrieval-Augmented Generation (RAG).
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# 1. Load the base model and tokenizer
base_model_id = "aisingapore/Llama-SEA-LION-v3-8B-IT"
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(base_model_id, device_map="auto", torch_dtype="auto")
# 2. Load your fine-tuned adapter
adapter_id = "jenniemoonsunset123/khmer-rag-model"
model = PeftModel.from_pretrained(base_model, adapter_id)
# 3. Test it!
prompt = "សួស្តី! តើអ្នកអាចជួយខ្ុំបានទេ?"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))