Downloads · 30 days
0
ErkaMarka/mongolian-gemma2-9b-chatbot
mongolian-gemma2-9b-chatbot is a machine learning model from ErkaMarka. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Gemma 2 9B fine-tuned on Mongolian news data for chatbot
Downloads · 30 days
0
Access
Public
Updated Jan 5, 2026
Repo size
2.7 GB
Likes
0
Public
Click a slice to open those files.
.pt1.7 GB · 55%
From the Hugging Face model README
Gemma 2 9B fine-tuned on Mongolian news data for chatbot
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("ErkaMarka/mongolian-gemma2-9b-chatbot")
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"google/gemma-2-9b-it",
torch_dtype=torch.float16,
device_map="auto"
)
# Resize embeddings for new tokens
base_model.resize_token_embeddings(len(tokenizer))
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "ErkaMarka/mongolian-gemma2-9b-chatbot")
# Generate
messages = [{"role": "user", "content": "Монгол улсын нийслэл хот юу вэ?"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=150)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Evaluated on 100 Mongolian Q&A pairs using BLEU score.
Apache 2.0
@misc{mongolian_gemma2_9b_chatbot},
author = {Your Name},
title = {mongolian-gemma2-9b-chatbot},
year = {2024},
publisher = {Hugging Face},
url = {https://huggingface.co/ErkaMarka/mongolian-gemma2-9b-chatbot}
}