sweatSmile/buddha-taught-qa
Viewer • Updated • 699 • 40 • 1
How to use sweatSmile/Gemma-3-270m-Buddha-QA with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("google/gemma-3-270m")
model = PeftModel.from_pretrained(base_model, "sweatSmile/Gemma-3-270m-Buddha-QA")How to use sweatSmile/Gemma-3-270m-Buddha-QA with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("question-answering", model="sweatSmile/Gemma-3-270m-Buddha-QA") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("sweatSmile/Gemma-3-270m-Buddha-QA", device_map="auto")This model was fine-tuned on a QA dataset about Buddhist teachings, designed for lightweight question-answering tasks.
{"prompt": ..., "completion": ...} format.nf4, double quantization, compute dtype = bf16 if supported)r = 8lora_alpha = 16lora_dropout = 0.1effective_batch_size = 6gradient_accumulation_steps = 3num_train_epochs = 8learning_rate = 2e-4lr_scheduler_type = cosinewarmup_ratio = 0.05weight_decay = 0.01max_grad_norm = 1.0fp16 = Truemax_seq_length = 64save_total_limit = 2| Prompt | Completion |
|---|---|
| Who is referred to as the Fully-Enlightened One in the text? | The Buddha is referred to as the Fully-Enlightened One. |
| Why did the speaker become a recluse? | The speaker became a recluse in the name of the Blessed One, his master. |
| Where does the Fully-Enlightened One live according to the text? | The Fully-Enlightened One lives in a city to the north, in India. |
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "sweatSmile/Gemma-3-270m-Buddha-QA"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo)
inputs = tokenizer("Who is referred to as the Fully-Enlightened One in the text?", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=64)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
If you use this model, please cite:
@misc{gemma-buddha-qa-2025,
title = {Gemma-3-270m Buddha-QA (LoRA 4-bit)},
author = {sweatSmile},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/sweatSmile/Gemma-3-270m-Buddha-QA}}
}
Base model
google/gemma-3-270m