Downloads · 30 days
0
zoeythanayot/gemma-1b-thai-lora-CoT
gemma-1b-thai-lora-CoT is a text generation model from zoeythanayot. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as gemma.
This model is a fine-tuned version of google/gemma-3-1b-it on Thai medical reasoning dataset. It has been optimized to provide Chain-of-Thought (CoT) reasoning for medical questions in Thai language.
Downloads · 30 days
0
Access
Public
Updated Aug 7, 2025
Repo size
5.6 GB
Likes
0
Public
Click a slice to open those files.
.pt3.1 GB · 55%
From the Hugging Face model README
This model is a fine-tuned version of google/gemma-3-1b-it on Thai medical reasoning dataset. It has been optimized to provide Chain-of-Thought (CoT) reasoning for medical questions in Thai language.
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
# Load base model
base_model_id = "google/gemma-3-1b-it"
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
device_map="auto",
torch_dtype=torch.float16
)
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "zoeythanayot/gemma-1b-thai-lora-CoT")
# Merge adapter weights (optional)
model = model.merge_and_unload()
# Example medical question in Thai
input_text = """Question: โรคเบาหวานคืออะไร?
Complex_CoT: โรคเบาหวาน (Diabetes mellitus) เป็นกลุ่มของโรคเมตาบอลิกที่มีลักษณะเฉพาะคือภาวะน้ำตาลในเลือดสูง (hyperglycemia) ซึ่งเกิดจากความผิดปกติของการหลั่งอินซูลิน (insulin secretion), การทำงานของอินซูลิน (insulin action) หรือทั้งสองอย่าง
Response: """
# Tokenize input
input_ids = tokenizer(input_text, return_tensors="pt").to(model.device)
# Generate response
with torch.no_grad():
outputs = model.generate(
**input_ids,
max_new_tokens=256,
do_sample=True,
temperature=0.7,
pad_token_id=tokenizer.eos_token_id
)
# Decode output
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
The model demonstrates strong performance in:
If you use this model in your research or applications, please cite:
@misc{gemma1b-thai-medical-cot,
title={Gemma-1B Thai Medical Chain-of-Thought},
author={Your Name},
year={2024},
publisher={Hugging Face},
howpublished={\url{https://huggingface.co/zoeythanayot/gemma-1b-thai-CoT}}
}
This model is licensed under the same terms as the base Gemma model. Please refer to the Gemma License for details.
For questions or issues regarding this model, please open an issue in the repository or contact the model author.
Disclaimer: This model is for research and educational purposes only. Always consult qualified healthcare professionals for medical advice and decisions.