Views
No views yet
openai/whisper-large-v3-turbo repurposed for audio captioning (not just speech transcription). The model takes 30s of audio and emits a long, descriptive natural-language caption covering speech, music, sound events, vocal bursts, and non-speech audio.learning_rate: 5e-4, cosine schedule, 5% warmupweight_decay: 0.0max_grad_norm: 1.0per_device_train_batch_size: 8gradient_accumulation_steps: 1bf16: true (fp16 was discarded because of grad-scaler overflows)max_audio_seconds: 30max_label_tokens: 448laion/majestrino-data — speech + detailed captionslaion/captioned-ai-music-snippets — music with comprehensive captionsmitermix/audioset-with-grounded-captions — general audio eventsTTS-AGI/majestrino-unified-detailed-captions-temporal — speech with temporal/emotion descriptionslaion/laions_got_talent_clean_with_captions — performance speech/musiclaion/freesound-commercially-permissive-subset-with-captionslaion/generated-sound-eventslaion/in-the-wild-sound-eventslaion/synthetic_vocal_bursts1import torch, librosa
2from transformers import WhisperProcessor, WhisperForConditionalGeneration
3
4model_id = "laion/captioning-whisper-large-turbo-wip"
5processor = WhisperProcessor.from_pretrained(model_id)
6model = WhisperForConditionalGeneration.from_pretrained(
7 model_id, torch_dtype=torch.bfloat16
8).to("cuda").eval()
9
10audio, sr = librosa.load("clip.wav", sr=16000, mono=True, duration=30.0)
11feats = processor.feature_extractor(
12 audio, sampling_rate=16000, return_tensors="pt"
13).input_features.to("cuda", torch.bfloat16)
14
15with torch.no_grad():
16 out = model.generate(
17 feats,
18 max_new_tokens=448,
19 num_beams=4,
20 do_sample=False,
21 )
22caption = processor.batch_decode(out, skip_special_tokens=True)[0]
23print(caption)max_new_tokens near 448 and prefer beam search over greedy for quality.model.safetensors) — bf16 Whisper-large-v3-turbo checkpoint at step 561,118code/ — the exact training pipeline used:
train.py — Seq2SeqTrainer-based fine-tuner with custom round-robin streaming dataset, manual rank-0 eval (HF distributed eval deadlocks here), and live monitor integrationprefetcher.py — tar-level background downloader that keeps ~2 tars per dataset hot on disk, with age-aware LRU eviction (MIN_EVICT_AGE_S = 600) to prevent in-flight eviction racesmonitor.py — HTTP dashboard (port 8077) with live loss, eval, audio playbackwatchdog.sh — auto-restart wrapperdownload_data.py — one-shot HF → local extractor with post-extract deletephase2_launcher.sh — phase-2 launch helpersave_pretrained only. Resuming optimizer-state-aware training from this checkpoint is not possible without starting a fresh optimizer (what we did for the in-flight resume: reduced peak LR to 1e-4 with a short 1% warmup since the cosine schedule had already decayed most of the way).code/ directory in this repo is a snapshot of the exact scripts running at the time of this checkpoint. The Seq2SeqTrainer in transformers>=4.57 requires a few API tweaks (processing_class= not tokenizer=, eval_strategy= not evaluation_strategy=, _get_train_sampler(train_dataset) etc.) — those are wired up in train.py.