Views
No views yet
📖 This checkpoint is part of the TinyWave distillation framework. See arXiv:2506.23670 for details.
| Role | Distillation Teacher |
|---|---|
| Base Model | spirit-lm-expressive-7b (SPIRIT-LM) |
| Fine-tuned on | Libri-Light (10k steps with LoRA) |
| Input Modalities | Interleaved speech + text |
| Output | Speech tokens |
| Used for | Training tinywave/interleaved-expressive-2b |
1git clone https://github.com/facebookresearch/spiritlm
2cd spiritlm
3pip install -e '.[eval]'1from spiritlm.speech_tokenizer import spiritlm_expressive
2speech_tokenizer = spiritlm_expressive()1from transformers import LlamaForCausalLM, AutoTokenizer
2import torchaudio
3import torch
4
5MODEL_PATH = "tinywave/expressive-spirit-lm-interleaved-librilight"
6tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
7model = LlamaForCausalLM.from_pretrained(MODEL_PATH, device_map="auto", torch_dtype=torch.bfloat16)
8
9# Interleaved speech input
10speech_tokenizer = spiritlm_expressive()
11
12def get_inference(audio_path):
13 audio, _ = torchaudio.load(audio_path)
14 input_values = audio.view(1, 1, -1).to(speech_tokenizer.hubert_model.device).float()
15 tokens = speech_tokenizer.encode_string(input_values)
16 input_ids = tokenizer(tokens, return_tensors="pt").input_ids.to(model.device)
17 output = model.generate(input_ids, max_new_tokens=256, do_sample=True, temperature=0.9, top_p=0.9)
18 return tokenizer.decode(output[0])
19
20def get_inference_text(prompt):
21 input_ids = tokenizer(prompt + " [Speech]", return_tensors="pt").input_ids.to(model.device)
22 output = model.generate(input_ids, max_new_tokens=256, do_sample=True, temperature=0.9, top_p=0.9)
23 return tokenizer.decode(output[0])"The astronaut stepped outside the capsule— [Speech]"speech.wav
Output: Semantically and stylistically aligned spoken continuation.pytorch_model.bin: LoRA-adapted SPIRIT-LM 7B weightsconfig.json, tokenizer.json: Compatible with Hugging Face Transformersspiritlm_expressive tokenizer only1@article{nouriborji2025tinywave,
2 title={Efficient Interleaved Speech Modeling through Knowledge Distillation},
3 author={Nouriborji, Mohammadmahdi and Rohanian, Morteza},
4 journal={arXiv preprint arXiv:2506.23670},
5 year={2025}
6}tinywave/interleaved-expressive-2b