Instructions to use SmallScale/Simple-Stories-Hindi-10M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SmallScale/Simple-Stories-Hindi-10M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SmallScale/Simple-Stories-Hindi-10M", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("SmallScale/Simple-Stories-Hindi-10M", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SmallScale/Simple-Stories-Hindi-10M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SmallScale/Simple-Stories-Hindi-10M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SmallScale/Simple-Stories-Hindi-10M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SmallScale/Simple-Stories-Hindi-10M
- SGLang
How to use SmallScale/Simple-Stories-Hindi-10M with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "SmallScale/Simple-Stories-Hindi-10M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SmallScale/Simple-Stories-Hindi-10M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "SmallScale/Simple-Stories-Hindi-10M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SmallScale/Simple-Stories-Hindi-10M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use SmallScale/Simple-Stories-Hindi-10M with Docker Model Runner:
docker model run hf.co/SmallScale/Simple-Stories-Hindi-10M
๐ Simple-Stories-Hindi-10M (11.45M Parameters)
A 11.45M parameter decoder-only Transformer language model trained from scratch on 2.11 million Hindi simple stories. The model generates coherent, creative, and grammatically sound Hindi stories given a short text prompt.
๐ Evaluation & Training Metrics
| Metric / Property | Value |
|---|---|
| Best Validation Loss | 1.8157 (Cross-Entropy Loss) |
| Total Training Steps | 202,000 steps |
| Total Parameters | 11,453,120 (11.45M) |
| Non-Embedding Parameters | 10,173,120 (10.17M) |
| Training Dataset | SmallScale/Simple-Stories-Hindi (~2.11M stories) |
| Model Size on Disk | ~45.8 MB (model.safetensors) |
๐๏ธ Model Architecture Details
| Parameter | Value | Notes |
|---|---|---|
| Architecture | LLaMA-style Decoder | RoPE + SwiGLU + RMSNorm |
Hidden Size (d_model) |
320 | Vector dimension |
| FFN Intermediate Size | 896 | 8/3 ร d_model rounded to multiple of 64 |
Layers (n_layers) |
7 | Transformer blocks |
Attention Heads (n_heads) |
5 | Multi-Head Self Attention |
| Head Dimension | 64 | d_model / n_heads |
Context Length (max_seq_len) |
512 tokens | Sequence window |
| Vocabulary Size | 4,000 | SentencePiece Unigram (Devanagari optimized) |
| Weight Tying | Enabled | Token embeddings & output projection share weights |
| Precision | float32 | Weights stored in native FP32 safetensors |
๐ Quick Start & Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load tokenizer and model directly from Hugging Face
tokenizer = AutoTokenizer.from_pretrained("SmallScale/Simple-Stories-Hindi-10M", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("SmallScale/Simple-Stories-Hindi-10M", trust_remote_code=True)
if torch.cuda.is_available():
model = model.to("cuda")
# Prompt input
prompt = "เคเค เคธเคฎเคฏ เคเฅ เคฌเคพเคค เคนเฅ"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
# Generate story
outputs = model.generate(
**inputs,
max_new_tokens=200,
do_sample=True,
top_k=40,
top_p=0.95,
temperature=0.8
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
๐ Sample Generated Stories
Prompt: เคเค เคธเคฎเคฏ เคเฅ เคฌเคพเคค เคนเฅ
เคเค เคธเคฎเคฏ เคเฅ เคฌเคพเคค เคนเฅ, เคเคฐ เคฎเฅเค เคเคพเคฏเคพ เคธเฅ เคฆเฅเคเคคเคพ เคนเฅเคเฅค เคฎเฅเคฐเฅ เคฆเฅ เคฒเฅเค, เคเฅเคจ เคเคฐ เคธเฅเคฎเฅเค เคฒ เคนเฅเค, เคเฅ เคเค เคญเคตเฅเคฏ เคฏเคพเคคเฅเคฐเคพ เคชเคฐ เคเคพ เคฐเคนเฅ เคนเฅเคเฅค เคตเฅ เคเค เคนเฅ เคธเฅเคฅเคพเคจ เคชเคฐ เคฐเคนเคคเฅ เคนเฅเค, เคฒเฅเคเคฟเคจ เคตเฅ เคฆเฅเคจเฅเค เค เคชเคจเฅ-เค เคชเคจเฅ เคเคนเคพเคจเคฟเคฏเคพเค เคเคพเคนเคคเฅ เคนเฅเค...
๐ Related Resources
- GGUF (FP16) Model Repo: SmallScale/Simple-Stories-Hindi-10M-GGUF
- 20M Model Repo: SmallScale/Simple-Stories-Hindi-20M
- Dataset: SmallScale/Simple-Stories-Hindi
๐ License
MIT License
- Downloads last month
- 18
docker model run hf.co/SmallScale/Simple-Stories-Hindi-10M