my-tiny-llama-ja

A compact Japanese-language causal language model. The repository now includes a standard Transformers checkpoint alongside the original PyTorch state dictionary and tokenizer.

Use this model

Install the runtime:

pip install torch transformers safetensors

Transformers pipeline

from transformers import pipeline

generator = pipeline(
    "text-generation",
    model="LoNebula/my-tiny-llama-ja",
    tokenizer="LoNebula/my-tiny-llama-ja",
)
result = generator("日本語:", max_new_tokens=64, do_sample=False)
print(result[0]["generated_text"])

Transformers classes

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

repo_id = "LoNebula/my-tiny-llama-ja"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForCausalLM.from_pretrained(repo_id)

inputs = tokenizer("日本語:", return_tensors="pt")
inputs.pop("token_type_ids", None)
with torch.inference_mode():
    output = model.generate(**inputs, max_new_tokens=64, do_sample=False)
print(tokenizer.decode(output[0], skip_special_tokens=True))

The Hub files support the standard transformers text-generation pipeline and AutoModelForCausalLM. CPU inference is available; a CUDA-enabled PyTorch installation can be used for GPU inference. Hosted inference requires a compatible Inference Provider or a separately deployed Inference Endpoint.

Model details

Property Details
Architecture LLaMA-style decoder-only causal language model
Vocabulary 32,000-token custom ByteLevel BPE tokenizer
Layers 6
Hidden size 512
Feed-forward size 1,536
License MIT
Task Japanese text generation

The original upload contained trained_model.pth and custom_tokenizer.json, but no model configuration or implementation. The Transformers conversion maps the original state-dict tensors into the standard LLaMA tensor names. The 8 attention heads, 2,048-token context setting, RMSNorm epsilon, and RoPE base in the conversion config are compatibility assumptions because the original training configuration was not included. The checkpoint can be loaded and run with Transformers, but these inferred settings may differ from its training-time settings.

The original files remain available in this repository for reproducibility. model.safetensors, config.json, tokenizer.json, and the tokenizer metadata enable standard Transformers loading without trust_remote_code.

Intended use

  • Small-scale Japanese text-generation experiments
  • Learning and prototyping with a compact causal language model
  • Research into custom Japanese tokenizers and lightweight model conversion

This is a base language model, not an instruction-tuned assistant. It may continue a prompt unpredictably and should not be relied on for factual answers.

Limitations and provenance

The original training data, training procedure, evaluation results, and exact model hyperparameters were not included with the published checkpoint. The configuration values above that cannot be read from tensor shapes are explicitly marked as assumptions. Generation quality has not been benchmarked. Review generated text before reuse.

This is a text-only causal language model. It is not an image, audio, or diffusion model; Diffusers and vision/audio pipelines do not apply.

License

The model is published under the MIT License. See the MIT License text for the full terms.

Citation

@misc{lonebula2025tinyllamaja,
  author = {LoNebula},
  title  = {my-tiny-llama-ja: A Tiny Japanese Language Model},
  year   = {2025},
  url    = {https://huggingface.co/LoNebula/my-tiny-llama-ja}
}
Downloads last month
25
Safetensors
Model size
53.2M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support