mondk/Msh-Tiny-47M

🤗 Hugging Face sourcetext-generationapache-2.047M params189 MBsafetensors✓ 1 checksumupdated today
Have the files? Submit a model torrent

If you have the complete model files and permission to share them, replace the example folder path and run this command. It checks your files, creates a torrent, and submits the magnet and checksums to Pirate Face. Keep your torrent client seeding so others can download from peers. Pirate Face does not receive the model files. Get your community key from your account. Read the script first if you like.

curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo mondk/Msh-Tiny-47M ./model-folder
Needs a seeder →

gguf: https://huggingface.co/mondk/Msh-Tiny-47M-GGUF

msh-tiny

A tiny (~47M parameter) GPT-2-architecture chat model, trained completely from scratch — no pretrained base model. Custom BPE tokenizer trained from zero, custom transformer trained from random initialization, then converted into a standard GPT2LMHeadModel for compatibility with the wider ecosystem.

Limitations

Trained from random initialization on a modest amount of data with limited compute — a small educational project, not a production-quality assistant. Expect reliable chat formatting but limited/inconsistent knowledge and occasional incoherent answers.

Prompt format

<|user|>
{your message}
<|assistant|>

The model stops generating at <|end|>.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model = AutoModelForCausalLM.from_pretrained("mondk/Msh-Tiny-47M")
tokenizer = AutoTokenizer.from_pretrained("mondk/Msh-Tiny-47M")

prompt = "<|user|>\nhi\n<|assistant|>\n"
input_ids = tokenizer(prompt, return_tensors="pt").input_ids
output = model.generate(input_ids, max_new_tokens=150, do_sample=True, temperature=0.7, top_k=40)
print(tokenizer.decode(output[0][input_ids.shape[1]:], skip_special_tokens=True))

Training data

Combining 15 well-known open instruction/chat datasets plus a small hand-written set of everyday chit-chat (greetings, thanks, small talk):

  • mondk/Greetings-hi-for-train-Msh-v2
  • tatsu-lab/alpaca
  • databricks/databricks-dolly-15k
  • teknium/OpenHermes-2.5
  • m-a-p/Code-Feedback
  • OpenAssistant/oasst1
  • FreedomIntelligence/medical-o1-reasoning-SFT
  • glaiveai/glaive-function-calling-v2
  • openai/openai_humaneval
  • HuggingFaceH4/no_robots
  • open-thoughts/OpenThoughts-114k
  • HuggingFaceH4/ultrachat_200k
  • google-research-datasets/poem_sentiment
  • CohereLabs/aya_dataset
  • sentence-transformers/natural-questions