Downloads · 30 days
12
3% of all-time downloads
Betrayedchair24/BIJA-5M
BIJA-5M is a text generation model from Betrayedchair24. 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.
Bija-5M is a compact GPT-style causal language model trained from scratch as an end-to-end language-modeling project. The project covers tokenizer training, document-level data splitting, binary dataset creation, Tran…
Downloads · 30 days
12
3% of all-time downloads
All-time downloads
432
Public
Parameters
7.3M
29.3 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors29.3 MB · 95%
From the Hugging Face model README
Bija-5M is a compact GPT-style causal language model trained from scratch as an end-to-end language-modeling project. The project covers tokenizer training, document-level data splitting, binary dataset creation, Transformer implementation, checkpointing, evaluation, Hugging Face export, and text generation.
This repository contains the Hugging Face export of the custom Bija architecture and is intended for experimentation, learning, and lightweight generation tests.
Bija-5M-Fixed was trained on a mixed English-language corpus designed to expose a small language model to multiple writing styles and domains.
The four sources used were:
The goal of this mixture was to improve general language modeling ability while keeping the pipeline compact, auditable, and reproducible.
The training mixture combines narrative text, educational web text, encyclopedic writing, and conversational dialogue. This gives the model exposure to child-friendly stories, broad web language, factual exposition, and short dialogue-style turns.
This dataset mixture was created for:
It was not created for:
A custom 12K byte-level BPE tokenizer was trained on a balanced document sample from all four sources.
Tokenizer design choices:
PADBOSEOSUNKDOCEach document was encoded in the form:
<BOS> <DOC> document tokens <EOS>
This preserves document boundaries and helps the model learn where documents begin and end.
Documents were assigned at the document level to train, validation, and test splits using a 98/1/1 ratio.
This design was chosen to:
The tokenized binaries were stored as uint16, which is sufficient for the 12,000-token vocabulary.
| Dataset | Train tokens | Validation tokens | Test tokens | Total tokens |
|---|---|---|---|---|
| TinyStories | 39,197,674 | 394,381 | 408,002 | 40,000,057 |
| FineWeb-Edu | 39,194,433 | 427,776 | 377,913 | 40,000,122 |
| Wikipedia | 19,637,001 | 168,144 | 194,939 | 20,000,084 |
| Conversations | 441,997 | 5,076 | 3,626 | 450,699 |
| Total | 98,471,105 | 995,377 | 984,480 | 100,450,962 |
Sampling probabilities were computed from the actual tokenized training files rather than planned corpus targets.
| Dataset | Sampling probability |
|---|---|
| TinyStories | 39.806% |
| FineWeb-Edu | 39.803% |
| Wikipedia | 19.942% |
| Conversations | 0.449% |
This was important because the conversation corpus was much smaller than originally intended, and using real token counts prevented severe oversampling.
Because the corpus includes web, encyclopedic, story, and dialogue text, it may contain:
Outputs from models trained on this data should be reviewed before real-world use.
from transformers import AutoModelForCausalLM, AutoTokenizer
repo_id = "Betrayedchair24/BIJA-5M"
tokenizer = AutoTokenizer.from_pretrained(
repo_id,
trust_remote_code=True,
)
model = AutoModelForCausalLM.from_pretrained(
repo_id,
trust_remote_code=True,
)
prompt = "User: Hello\nAssistant:"
inputs = tokenizer(prompt, return_tensors="pt")
output = model.generate(
**inputs,
max_new_tokens=60,
do_sample=True,
temperature=0.8,
top_p=0.95,
)
print(tokenizer.decode(output[0], skip_special_tokens=True))
Bija-5M-Fixed improved over the original run by:
This repository uses custom Transformers code, so load it with trust_remote_code=True.
from transformers import AutoModelForCausalLM, AutoTokenizer
repo_id = "Betrayedchair24/BIJA-5M"
tokenizer = AutoTokenizer.from_pretrained(
repo_id,
trust_remote_code=True,
)
model = AutoModelForCausalLM.from_pretrained(
repo_id,
trust_remote_code=True,
)
prompt = "User: Hello\nAssistant:"
inputs = tokenizer(prompt, return_tensors="pt")
output = model.generate(
**inputs,
max_new_tokens=60,
do_sample=True,
temperature=0.8,
top_p=0.95,
)
print(tokenizer.decode(output[0], skip_special_tokens=True))
This repository is released under the Apache License 2.0, declared in the metadata above as apache-2.0.
Developed by Amitabh Dey (LinkedIn)