Run this model with HF Jobs

Run hcxlabs/echora-kara-300m on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/hcxlabs/echora-kara-300m. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/hcxlabs/echora-kara-300m on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Echora Kara 300M

Syllable-level lyrics alignment for karaoke. Given a song and its lyrics, the model works out when each word and syllable is sung, so karaoke highlighting follows the voice. It was trained on full song mixes and needs no vocal separation.

This repository holds the weights. The code that runs them (lyric normalizer, alignment engine, command line, training) is Echora Kara, and the model is the karaoke engine of Echora.

Model details

Component What it is Parameters
Acoustic encoder wav2vec2-style transformer, 24 layers, width 1024, 20 ms frames at 16 kHz. Initialised from Meta's omniASR CTC 300M v2 315 M
CTC head 30 outputs: letters a–z, apostrophe, word separator, unknown, blank 31 k
Edge head per-frame logit that a new acoustic unit starts 1 k
Background head a second CTC head for backing vocals 31 k
Text head 6 text-encoder layers over the song's lyrics and 4 cross-attention layers from audio frames to text 38.3 M

About 354 M parameters are stored here.

Lyrics are spelled with a 30-symbol romanised alphabet by the Echora Kara normalizer, label rules v3-sung: English, German and French by pronunciation, Japanese by kana reading, Korean by pronunciation rules, Chinese by pinyin or jyutping, and other scripts by romanisation. The model must be run with these label rules.

Usage

Wav2Vec2ForCTC.from_pretrained loads only the encoder and the lead CTC head. The other heads and the decoder need Echora Kara:

git clone https://github.com/hcx-labs/echora-kara && cd echora-kara
pip install -e . && sh scripts/fetch_resources.sh          # plus espeak-ng and ffmpeg
hf download hcxlabs/echora-kara-300m --local-dir models/echora-kara-300m

mkdir work && cp lyrics.txt work/i.txt                      # one sung line per line
ECHORA_KARA_TEXT_BONUS=0.4 ECHORA_KARA_IN_LINE_GAP_COST=0.2 \
echora-kara-align --path_io work --input_audio song.flac --input_text i.txt \
  --model yohane --hf_model_path models/echora-kara-300m --label_rules v3-sung --lang auto \
  --head_correct 0 --tail_correct 0 --timing_offset_ms 0 \
  --min_token_ms 100 --min_letter_ms 40 --duration_pace_ratio 0.9 --vocal_activity_weight 2.0 \
  --exact_frame_clock --blank_free_tokens --background_decoding

This writes work/o.ass (karaoke \k tags), work/o_ruby.lrc and work/o.alignment.json. Lines written entirely in brackets, such as (so lonely), are treated as backing vocals.

These are the settings the benchmark below was measured with. Echora uses the same settings on a separated vocal stem, which it already extracts for other features.

Benchmark

Word-start error on JamendoLyrics MultiLang: 79 songs and 21,580 words in English, German, Spanish and French. Songs are aligned on the original mix, with no vocal separation, and every word's predicted start is compared with the reference start.

Metric With the text head (bonus 0.4) Acoustic heads only
Median error 38.8 ms 40.2 ms
Mean error 113.7 ms 195.4 ms
Words within 50 ms 61.0 % 59.4 %
Words within 300 ms 96.9 % 95.9 %
Words off by more than 500 ms 2.4 % (525) 3.3 % (710)
Per-song average, words within 300 ms 96.4 % 95.2 %
Per-song average, absolute error 0.133 s 0.229 s

The last two rows average each song's score over the 79 songs, as the JamendoLyrics benchmark does.

Language Songs Words Median Mean Within 50 ms Within 300 ms Over 500 ms
German 20 5,157 29.4 ms 54.7 ms 72.7 % 98.8 % 0.9 %
English 20 5,693 37.3 ms 119.2 ms 62.0 % 95.9 % 3.1 %
Spanish 20 5,269 35.9 ms 96.8 ms 65.1 % 98.2 % 1.4 %
French 19 5,461 56.1 ms 180.0 ms 44.8 % 94.7 % 4.1 %

The text bonus weight was picked on five of the 79 songs, so the figures are lightly tuned to this set.

Training

  • Data: word- and syllable-timed lyrics paired with the original recordings, as full mixes. Validation and test songs are held out by artist.
  • Schedule: one run from the omniASR initialisation with every component trained from step 0: 1,000 steps with the encoder frozen, a 1,000-step warm-up, then cosine decay over 100,000 steps of 8 windows each. These weights are step 74,000, the best checkpoint on a 40-song decoded evaluation.
  • Windows: 20–27 s, ending in gaps between sung fragments.
  • Losses: a constrained-alignment CTC loss, an onset (edge) loss, a background-head CTC loss and the text-head losses.

The recipe is scripts/train_clean100k_dm.sh in Echora Kara, without its three --decoder-margin-* flags. That script also attaches an experimental music-feature branch (--fusion*). Its gate stayed at zero throughout the run, so it contributed nothing and is not part of these weights.

Limitations

  • French is the weakest of the benchmarked languages. Outside the benchmark, Japanese and Korean have been checked by ear on a few songs; other languages have not been evaluated.
  • A loud backing vocal sung over a quiet lead can pull the lead line a few seconds late.
  • Repeated phrases, long held notes, ad-libs, rap and heavy vocal effects can produce inaccurate boundaries.
  • Timings follow the lyrics as given: missing, extra or reordered lines are not detected.
  • The text head must be run in windows of about 25 s, the length it was trained on. Echora Kara does this.

Licence and use restrictions

The weights are released under CC BY-NC 4.0: the model may only be used non-commercially.

You are responsible for having the necessary rights to the audio and lyric text you process.

The Echora Kara code is AGPL-3.0; see its repository for third-party terms.

Acknowledgements

Omnilingual ASR (Meta) for the encoder initialisation and FA-Kara by moriwx, where the alignment pipeline started.

Downloads last month
139
Safetensors
Model size
0.4B params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for hcxlabs/echora-kara-300m

Quantizations
1 model