telugu-song-model
Developed by AGK FIRE INC.
A small Telugu movie-song model: Udgam Labs Vemana-Base (278M parameters) fine-tuned on 665 Telugu film songs (1991–2024), so it writes in the form of Telugu film lyrics — pallavi, charanam-style stanzas, and the returning refrain.
What it does
Given the first line of a song, it continues in Telugu song form: rhyming lines, parallel phrasing, and the pallavi coming back — the structure of a film song. It learned the form of Telugu songs well. What it does not do is quote real songs verbatim — see Evaluation below.
Evaluation (honest result)
Verbatim exact-match test on 40 held-out songs (first line given as the cue, greedy decoding, exact match after Unicode + whitespace normalisation):
| Model | Verbatim exact match |
|---|---|
| Vemana-Base (base) | 0 / 40 |
| telugu-song-model (fine-tuned) | 0 / 40 |
Low is good here: an exact match would mean the model copied a real, copyrighted song. Both models score 0 — the fine-tune did not memorise the held-out songs (they were excluded from training), and the base model had not memorised them from the web either. What changed is visible in the outputs: the fine-tuned model writes song-shaped Telugu — rhyming stanzas, parallel lines, a returning pallavi — where the base model wandered off-form. For accurate verbatim lyrics, use a licensed source, not this model.
Decoding matters more than training here. With greedy decoding the fine-tuned model loops, repeating the cue line itself ("చుట్టమల్లే చుట్టేస్తాంది" ×8, "రం రం" ×30+) — songs repeat by design, and greedy always picks the single most likely next word, so it gets stuck. With sampling (temperature 0.8, top-p 0.9, repetition penalty 1.15) the same model writes a real song from a fresh first line. Use sampling, not greedy, with this model.
Training data
- Source:
Akashpalli/Telugu_songs_lyricson Hugging Face — 717 songs, years 1991–2024, Telugu script, with movie / lyricist / music director / year metadata. Scraped lyrics carry occasional typos, left as-is. - Training documents: 1,330 — raw songs (665) and first-line → song cues (665). The 40 evaluation songs were excluded from every document type.
- Dataset: agk4444/telugu-songs-finetune (private).
Training procedure
- Base:
udgamlabs/Vemana-Base(278,214,144 params, Gemma-4 text layout, own 32,000-token SentencePiece tokenizer, Apache-2.0). - 3 epochs, learning rate 5e-5 with cosine decay, 3% warmup.
- Effective batch 32 (micro-batch 2 × 2 GPUs × 8 accumulation steps).
- fp32 weights with fp16 autocast (T4 has no bf16), activation checkpointing, max sequence length 1,024.
- Hardware: Kaggle 2× NVIDIA T4, ~18 min, 126 steps. Final training loss ≈ 2.45 (2.88 at step 20 → 2.45 at step 80).
- Software: transformers 5.23.0, torch, datasets, accelerate.
How to use
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
tok = AutoTokenizer.from_pretrained("agk4444/telugu-song-model")
model = AutoModelForCausalLM.from_pretrained(
"agk4444/telugu-song-model", dtype=torch.float32
)
model.eval()
# Sampling, NOT greedy — greedy loops on song repetition (see Evaluation)
cue = "మొదటి పంక్తి: చందమామ నవ్వింది నీ కళ్ళలో\nపూర్తి పాట:\n"
ids = tok(cue, return_tensors="pt")
out = model.generate(**ids, max_new_tokens=300, do_sample=True,
temperature=0.8, top_p=0.9, repetition_penalty=1.15,
pad_token_id=tok.eos_token_id)
print(tok.decode(out[0][ids["input_ids"].shape[1]:], skip_special_tokens=True))
GGUF (CPU, llama.cpp)
telugu-song-model-q8_0.gguf (~285 MB, Q8_0) — the same fine-tuned weights,
quantized for CPU inference with llama.cpp.
Verified on CPU with sampling settings matching the transformers test above.
# use llama-completion, not llama-cli: llama-cli wraps the prompt in a chat
# template, which this base-style model does not want
llama-completion -m telugu-song-model-q8_0.gguf \
-f prompt.txt -n 200 --temp 0.8 --top-p 0.9 \
--repeat-penalty 1.15 --repeat-last-n 64
with prompt.txt containing:
మొదటి పంక్తి: చందమామ నవ్వింది నీ కళ్ళలో
పూర్తి పాట:
Note: the config.json in this repo has the architecture fields corrected
(head_dim 128, first layer sliding_attention, sliding_window 4096) so
llama.cpp can load it — the values the notebook saved from the base model
(head_dim 64, all layers full_attention) crash llama.cpp's Gemma-4
support with a sliding-window assertion. The weights are unchanged; the
tensor shapes (q_proj 1024×1024) prove head_dim 128 is correct.
Limitations
- No verbatim recall of real songs (0/40, see above). Do not use it as a source of lyrics.
- Greedy decoding loops — always use sampling with a repetition penalty.
- Small (278M) base model: later stanzas wobble, it invents words, and lines can be garbled. First stanzas are the strongest.
- Film lyrics are copyrighted: this model is for personal/research use; do not publish outputs that reproduce a real song verbatim.
- Telugu only. Context 1,024 tokens (~570 Telugu words).
License
Apache-2.0, same as the base model.