Instructions to use asharrm/musicwiki-lm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use asharrm/musicwiki-lm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="asharrm/musicwiki-lm")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("asharrm/musicwiki-lm") model = AutoModelForCausalLM.from_pretrained("asharrm/musicwiki-lm", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use asharrm/musicwiki-lm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "asharrm/musicwiki-lm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "asharrm/musicwiki-lm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/asharrm/musicwiki-lm
- SGLang
How to use asharrm/musicwiki-lm 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 "asharrm/musicwiki-lm" \ --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": "asharrm/musicwiki-lm", "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 "asharrm/musicwiki-lm" \ --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": "asharrm/musicwiki-lm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use asharrm/musicwiki-lm with Docker Model Runner:
docker model run hf.co/asharrm/musicwiki-lm
MusicWiki-LM 33M
A 33M-parameter language model trained from scratch on 375k English Wikipedia articles about music (artists, bands, albums, songs, genres), on a single PlayStation 5 APU (AMD gfx1013, 36 CUs, 16 GB shared memory) running Linux with a hand-ported ROCm/PyTorch stack. Training ran in two rounds: one night, then a second round the next day that continued from the first round's final checkpoint to give it more passes over the same articles.
It writes Wikipedia-style music articles and infobox lines, and remembers a little about artists it has read about. It is a small research/hobby model, not a factual reference: it confidently invents facts.
Use
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("asharrm/musicwiki-lm")
model = AutoModelForCausalLM.from_pretrained("asharrm/musicwiki-lm")
prompt = "# Kind of Blue\nkind: album\nartist:"
ids = tok(prompt, return_tensors="pt").input_ids
out = model.generate(ids, max_new_tokens=150, do_sample=True, top_k=40, temperature=0.8)
print(tok.decode(out[0]))
Versions. main is round 2 (step 10,150). The round-1 model (step 4,658, held-out loss 2.912) is the round1 tag: from_pretrained("asharrm/musicwiki-lm", revision="round1").
Prompt format. Documents look exactly like the training data:
# <Title>
kind: artist | album | song | ...
<infobox field>: <value> (e.g. genre:, label:, artist:, origin:, released:)
...
<blank line>
<article prose>
Start with # Title\n (optionally kind: and some fields) and let it continue. Documents end with <|eos|>.
Model
| Architecture | Llama (RMSNorm, RoPE, SwiGLU, tied embeddings), LlamaForCausalLM |
| Parameters | 33.3M total (8.4M embedding, tied) |
| Layers / width / heads | 8 / 512 / 4 (head dim 128) |
| FFN | 1344 |
| Context | 1024 tokens |
| Tokenizer | byte-level BPE, 16,384 tokens, trained on this corpus |
Data
- English Wikipedia dump of 2026-10-08, filtered to music articles via Wikidata (songs/singles, albums, groups,
musicians, genres): 375k articles after cleaning (markup stripped; infobox kept as
key: valuelines). - 272M training tokens; 0.5% of articles (by title hash) held out: 1.38M tokens.
- Text is © Wikipedia contributors, licensed CC BY-SA 4.0; this model is released under the same license.
Training
| Hardware | Sony PlayStation 5 APU (AMD Oberon, gfx1013) under Linux 7.1, PyTorch 2.9.1 built for gfx1013 |
| Precision | fp32 (this GPU's fp16/bf16 GEMM paths were ~7x slower than fp32) |
| Throughput | ~13.8k tokens/s, die temperature max 91 °C |
| Steps | 10,150 × 65,536 tokens = 665M tokens (2.45 epochs) |
| Optimizer | AdamW (β 0.9/0.95, wd 0.1, clip 1.0) |
| Schedule | warmup-stable-decay, run twice. Round 1: 200 warmup steps to lr 0.002, 1-sqrt decay to 0 over steps 3,858–4,658. Round 2: lr re-warmed over 300 steps to 0.002, held, then decayed to 0 over steps 9,150–10,150 |
| Wall clock | round 1 23:45:45 → 06:48 IST (paused once at step 3,275 for ~40 min while another GPU job ran; resumed from the checkpoint); round 2 11:52 → 19:13 IST the same day |
Results
Held-out loss (articles never seen in training):
| step | tokens | val loss | val ppl |
|---|---|---|---|
| 250 | 16M | 4.548 | 94.4 |
| 1250 | 82M | 3.357 | 28.7 |
| 2250 | 147M | 3.189 | 24.3 |
| 3250 | 213M | 3.108 | 22.4 |
| 4000 | 262M | 3.017 | 20.4 |
| 4658 | 305M | 2.912 | 18.4 |
| 4750 | 311M | 2.926 | 18.7 |
| 5750 | 377M | 3.029 | 20.7 |
| 6750 | 442M | 3.000 | 20.1 |
| 7750 | 508M | 2.985 | 19.8 |
| 8750 | 573M | 2.967 | 19.4 |
| 9750 | 639M | 2.839 | 17.1 |
| 10150 | 665M | 2.810 | 16.6 |
Final held-out loss 2.810 (perplexity 16.6) with this 16k tokenizer. Round 1 ended at 2.912.
Fact recall. Prompt = the article header up to an infobox field (artist:, genre:, label:, origin:),
greedy-decode the line, exact match of the first item. Baseline = always answering the most common value for that
field and article kind.
| set | round 2 | round 1 | baseline |
|---|---|---|---|
| seen in training (400 articles) | 19.8% | 19.0% | 6.8% |
| held-out articles (217) | 17.1% | 11.5% | 8.3% |
By field (seen / held-out):
| field | seen | held-out |
|---|---|---|
| artist | 32/112 | 9/40 |
| genre | 37/132 | 24/86 |
| label | 8/135 | 3/73 |
| origin | 2/21 | 1/18 |
Held-out facts mostly test inference from context (e.g. an album's genre from its artist), not memory.
Samples (final checkpoint; temperature 0.8, top-k 40, repetition penalty 1.1)
Unedited model output from a title prompt. Every name, date, quote and review in them is invented by the model.
# Radiohead
kind: artist
years active: 2015–present
genre: Indie rock | dance-punk | electronic
label: Sony Music | Universal Republic | RCA | Island
current members: * David Cook | James Dean | David Bekenhorn | Mark Morton
past members: * Alex Dutton | Andrew Goldstein | James Mercer | Tom Snyder
A Radiohead are an English pop rock band from Oxford, England. The band's sound has been described as "experimental pop".
History
A Radiohead released their debut EP in 2015 on the iTunes Store alongside a number of tracks. They signed with Sony Music UK and released their first album, A Pool in the Trees in November 2016. Radiohead became known for their energetic live performances, including op
# Kind of Blue
kind: album
type: Album
artist: Bill Evans
released: July 1961Billboard June 2, 1961
recorded: August 27, 1960 – September 29, 1961
genre: Jazz
label: MainstreamMRC-1581
producer: Teo Macero
Kind of Blue is an album by saxophonist Bill Evans released on the Mainstream label in 1961. The album reached number 145 on the Billboard 200 chart in 1961.
Overview
The album consists of two sessions in late 1960 with two tracks recorded in early July 1960, featuring Evans and Macero playing seven originals for the label. On "Find Me", Evans plays alto saxophone alongside Macero with his group the Concierto Infantil on second tenor and tenor sax. On "I've Got My
# Shoegaze
kind: album
type: Compilation album
artist: various artists
released: 23 September 2001
genre: Experimental rock
label: Nettwerk: A Cassette Recordings (2001)
producer: Various
Khoegaze is a compilation album of music by artists featuring the works of other artists. It was released on 23 September 2001, and peaked at number 13 on the CMJ New Music Report.<|eos|>
# Bohemian Rhapsody
kind: song
type: single
artist: Víctor Jara
album: Dóla
released: 2004 | 04 | 29
recorded: 2003
genre: Pop
label: BMG
producer: Nino León
"Hombres de Mi Coro" () is a song recorded by Chilean singer Víctor Jara. It was released as the second single from her album Dóla on April 29, 2004 ("Dóla"). It was written by Ibero-Spanish and produced by Nino León. The music video for this song was directed by Pedro Damián and premiered on MTV Chile, becoming even more popular with Chilean audiences. "Hombres de Mi Coro" received an award nomination for Song of the Year at the Latin Grammy Awards of
Limitations
- 33M parameters and 2.45 passes over the data: it hallucinates artists, dates, chart positions, labels and review quotes freely, including attributing invented quotes to real critics.
- English Wikipedia's coverage biases (Anglophone, 20th-century, popular music) carry over.
- Not instruction-tuned; it only continues documents.
Why
A test of how much can be trained overnight on a games console's GPU with a home-made ROCm port, and a base model for music-domain experiments (playlist generation, music metadata).
- Downloads last month
- 11