Downloads · 30 days
58
8% of all-time downloads
Naphon/pythia-2.8b-thai-base-v1
pythia-2.8b-thai-base-v1 is a text generation model from Naphon. 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.
Downloads · 30 days
58
8% of all-time downloads
All-time downloads
763
Public
Parameters
2.9B
11.7 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors5.9 GB · 100%
From the Hugging Face model README
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "Naphon/pythia-2.8b-thai-base-v1"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True
)
text = "รองศาสตราจารย์ ดร.สุวิทย์ แซ่เตีย อธิการบดีมหาวิทยาลัยเทคโนโลยีพระจอมเกล้าธนบุรี"
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=50, do_sample=True, temperature=0.9)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))