Downloads · 30 days
1.1K
100% of all-time downloads
KordAI/ThaiLLM-8B
ThaiLLM-8B is a text generation model from KordAI. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
KordAI/ThaiLLM-8B is an 8B-parameter large language model with strong Thai language capabilities.
Downloads · 30 days
1.1K
100% of all-time downloads
All-time downloads
1.1K
Public
Parameters
8.2B
16.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors16.4 GB · 100%
From the Hugging Face model README
KordAI/ThaiLLM-8B is an 8B-parameter large language model with strong Thai language capabilities.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "KordAI/ThaiLLM-8B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
messages = [
{
"role": "user",
"content": "อธิบายให้หน่อยว่าทำไมท้องฟ้าถึงเป็นสีฟ้า",
}
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt",
).to(model.device)
with torch.no_grad():
outputs = model.generate(
inputs,
max_new_tokens=512,
temperature=0.7,
top_p=0.9,
do_sample=True,
)
response = tokenizer.decode(
outputs[0][inputs.shape[-1]:],
skip_special_tokens=True,
)
print(response)
For chat/instruction use, pass messages in the standard format:
messages = [
{
"role": "system",
"content": "คุณคือผู้ช่วยที่ตอบคำถามอย่างกระชับและถูกต้อง",
},
{
"role": "user",
"content": "ประเทศไทยมีเมืองหลวงชื่ออะไร?",
},
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
print(prompt)
For deterministic generation:
outputs = model.generate(
inputs,
max_new_tokens=256,
do_sample=False,
)
For sampling:
outputs = model.generate(
inputs,
max_new_tokens=512,
temperature=0.7,
top_p=0.9,
do_sample=True,
)
KordAI/ThaiLLM-8BThe model may occasionally produce incorrect or unsupported information. Verify outputs for factual or high-stakes use cases.
@misc{kordai_thaillm_8b,
title = {KordAI/ThaiLLM-8B},
author = {KordAI},
year = {2026},
url = {https://huggingface.co/KordAI/ThaiLLM-8B}
}