Downloads · 30 days
3
16% of all-time downloads
daraa1607/daralm-50m
daralm-50m is a text generation model from daraa1607. Use it when you need the model to write or continue text. The card lists the license as cc-by-sa-4.0.
DaraLM-50M is a 33.4M-parameter Khmer/English base language model implemented from scratch in PyTorch. It is an educational artifact, not a production or factual question-answering model.
Downloads · 30 days
3
16% of all-time downloads
All-time downloads
19
Public
Repo size
268 MB
Likes
1
Public
Click a slice to open those files.
.pt133 MB · 100%
From the Hugging Face model README
DaraLM-50M is a 33.4M-parameter Khmer/English base language model implemented from scratch in PyTorch. It is an educational artifact, not a production or factual question-answering model.
This is a raw completion model. For the instruction-tuned checkpoint, see
daraa1607/daralm-50m-instruct.
| Field | Value |
|---|---|
| Parameters | 33,366,528 |
| Hidden size | 512 |
| Layers / heads | 8 / 8 |
| Feed-forward size | 2,048 |
| Context | 1,024 tokens |
| Vocabulary | 16,000 SentencePiece Unigram tokens |
The decoder uses RMSNorm, causal attention, RoPE, GELU feed-forward layers, and tied input/output embeddings.
This custom architecture is not directly compatible with
AutoModelForCausalLM. Clone the
DaraLM repository for its model
implementation.
import torch
from huggingface_hub import hf_hub_download
from daralm.inference.generator import generate
from daralm.model.config import ModelConfig
from daralm.model.transformer import DaraLMTransformer
from daralm.tokenizer.tokenizer import DaraLMTokenizer
repo_id = "daraa1607/daralm-50m"
weights_path = hf_hub_download(repo_id, "pytorch_model.pt")
config_path = hf_hub_download(repo_id, "config.yaml")
tokenizer_path = hf_hub_download(repo_id, "tokenizer.model")
config = ModelConfig.from_yaml(config_path)
tokenizer = DaraLMTokenizer.from_pretrained(tokenizer_path)
model = DaraLMTransformer(config.architecture, pad_token_id=tokenizer.pad_id)
release = torch.load(weights_path, map_location="cpu", weights_only=True)
model.load_state_dict(release["model_state_dict"])
model.eval()
text = generate(
model,
tokenizer,
prompt="Cambodia is",
max_new_tokens=50,
temperature=0.8,
top_p=0.9,
)
print(text)
pytorch_model.pt contains inference weights and basic metadata. It does not
contain optimizer, scheduler, or RNG state for resuming training.
This checkpoint predates the repository’s later corpus expansion and Common Crawl merge.
Do not use this model for factual, medical, legal, financial, or safety-critical decisions.
Code is MIT licensed. Wikipedia training data is CC BY-SA 4.0 / GFDL, and the weights inherit applicable share-alike terms.