wikimedia/wikipedia
Viewer β’ Updated β’ 61.6M β’ 239k β’ 1.38k
How to use amanuelbyte/amharic-50m-architecture-benchmark with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="amanuelbyte/amharic-50m-architecture-benchmark") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("amanuelbyte/amharic-50m-architecture-benchmark", device_map="auto")How to use amanuelbyte/amharic-50m-architecture-benchmark with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "amanuelbyte/amharic-50m-architecture-benchmark"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "amanuelbyte/amharic-50m-architecture-benchmark",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/amanuelbyte/amharic-50m-architecture-benchmark
How to use amanuelbyte/amharic-50m-architecture-benchmark with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "amanuelbyte/amharic-50m-architecture-benchmark" \
--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": "amanuelbyte/amharic-50m-architecture-benchmark",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "amanuelbyte/amharic-50m-architecture-benchmark" \
--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": "amanuelbyte/amharic-50m-architecture-benchmark",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use amanuelbyte/amharic-50m-architecture-benchmark with Docker Model Runner:
docker model run hf.co/amanuelbyte/amharic-50m-architecture-benchmark
This repository contains trained checkpoints, benchmark logs, and evaluation reports for 4 distinct ~50M parameter language model architectures trained from scratch on the Amharic Wikipedia corpus using an RL-trained subword tokenizer (3,919 tokens).
| Architecture | Model Class | Parameters | Distinct Features |
|---|---|---|---|
| Qwen3.5 (Transformer) | TransformerLM |
50.79M | 3:1 Gated DeltaNet / Gated Attention, Zero-Centered RMSNorm, Partial RoPE (0.25), Multi-Token Prediction (MTP) Head |
| HRM-Text | HRMLM |
49.02M | Dual-timescale H2L3 Recurrence, MagicNorm parameterless RMSNorm, PrefixLM masking, Warmup TBPTT ($2 \rightarrow 5$) |
| Mamba SSM | MambaLM |
49.47M | Selective State Space Model, dt_rank=32, S4D $A_{\text{log}}$, specialized log-uniform $\Delta$ initialization |
| Hybrid Mamba-Transformer | HybridMambaTransformerLM |
52.04M | Interleaved 2:1 Mamba to Qwen3.5 Attention, Unified SwiGLU FFN, Idempotent Depth-Scaling |
βββ models/ # PyTorch architecture implementations
β βββ transformer_lm.py # Qwen3.5 3:1 DeltaNet + Attention + MTP
β βββ hrm_lm.py # HRM-Text H2L3 recurrence
β βββ mamba_lm.py # Mamba selective SSM
β βββ hybrid_lm.py # Hybrid Mamba + Qwen attention
βββ tokenizer/ # Amharic subword tokenizer
β βββ vocab.txt
β βββ config.json
βββ checkpoints/ # Best model weights for each architecture
β βββ transformer/best_model.pt
β βββ hrm/best_model.pt
β βββ mamba/best_model.pt
β βββ hybrid/best_model.pt
βββ analysis/ # Comparative benchmark results & plots
βββ report.md
βββ results_table.tex
βββ loss_curves.png
βββ throughput_scaling.png
βββ pareto_frontier.png
import torch
from models import create_model
# Load model architecture
model = create_model("transformer", vocab_size=3919)
# Load checkpoint
checkpoint = torch.load("checkpoints/transformer/best_model.pt", map_location="cpu")
model.load_state_dict(checkpoint["model_state"], strict=False)
model.eval()
# Generate tokens
tokens = torch.tensor([[2, 45, 128, 902]], dtype=torch.long)
with torch.no_grad():
logits, _ = model(tokens)
next_token = torch.argmax(logits[:, -1, :], dim=-1)
print("Next token ID:", next_token.item())
If you use these models or comparative benchmarks in your research, please cite: