Downloads · 30 days
22
7% of all-time downloads
JohnMarble/vi-en-glm
vi-en-glm is a machine learning model from JohnMarble. 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 unknown.
This model is a Small Language Model (SLM) based on the GLM (General Language Model) architecture, trained from scratch to support both English and Vietnamese. It was developed as part of a NLP project to explore bili…
Downloads · 30 days
22
7% of all-time downloads
All-time downloads
301
Public
Parameters
212M
60.9 GB on disk
Likes
1
Public
Click a slice to open those files.
.pt1.7 GB · 50%
From the Hugging Face model README
This model is a Small Language Model (SLM) based on the GLM (General Language Model) architecture, trained from scratch to support both English and Vietnamese. It was developed as part of a NLP project to explore bilingual text generation and cross-lingual understanding in a resource-constrained environment.
The model was trained on an interleaved dataset consisting of 52,000 English and 52,000 Vietnamese samples from Wikipedia. The datasets were cleaned to remove Wikipedia markdown and filtered for high-quality content longer than 100 characters.
The training was conducted on 2 Kaggle T4 GPU utilizing fp16 precision and tf32 for optimized performance.
from transformers import GlmForCausalLM, PreTrainedTokenizerFast
model = GlmForCausalLM.from_pretrained("JohnMarble/vi-en-glm")
tokenizer = PreTrainedTokenizerFast.from_pretrained("JohnMarble/vi-en-glm")
prompt = "Việt Nam là một quốc gia"
inputs = tokenizer(prompt, return_tensors="pt", return_token_type_ids=False)
outputs = model.generate(
**inputs,
max_length=50,
do_sample=True,
top_p=0.9,
temperature=0.7
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))