MCPcopy Index your code
hub / github.com/facebookresearch/spiritlm

github.com/facebookresearch/spiritlm @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
380 symbols 985 edges 34 files 66 documented · 17% updated 20mo ago★ 93012 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Meta Spirit LM: Interleaved Spoken and Written Language Model

This repository contains the model weights, inference code and evaluation scripts for the Spirit LM paper. You can find more generation samples on our demo page.

Spirit LM Model Overview

Installation Setup

Conda

conda env create -f env.yml
pip install -e '.[eval]'

Pip

pip install -e '.[eval]'

Dev

(Optionally, use only if you want to run the tests.)

pip install -e '.[dev]'

Checkpoints Setup

See checkpoints/README.md

Quick Start

Speech Tokenization

See spiritlm/speech_tokenizer/README.md

Spirit LM Generation

See spiritlm/model/README.md

Speech-Text Sentiment Preservation benchmark (STSP)

See spiritlm/eval/README.md

Model Card

More details of the model can be found in MODEL_CARD.md.

License

The present code is provided under the FAIR Noncommercial Research License found in LICENSE.

Citation

@misc{nguyen2024spiritlminterleavedspokenwritten,
      title={SpiRit-LM: Interleaved Spoken and Written Language Model},
      author={Tu Anh Nguyen and Benjamin Muller and Bokai Yu and Marta R. Costa-jussa and Maha Elbayad and Sravya Popuri and Paul-Ambroise Duquenne and Robin Algayres and Ruslan Mavlyutov and Itai Gat and Gabriel Synnaeve and Juan Pino and Benoit Sagot and Emmanuel Dupoux},
      year={2024},
      eprint={2402.05755},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2402.05755},
}

Core symbols most depended-on inside this repo

LayerNorm
called by 11
spiritlm/speech_tokenizer/hubert/hubert_model/wav2vec2_model.py
eval
called by 7
spiritlm/eval/eval_stsp.py
get_padding
called by 6
spiritlm/speech_tokenizer/hifigan/hifigan_vocoder.py
ChoiceEnum
called by 5
spiritlm/speech_tokenizer/hubert/hubert_model/wav2vec2_model.py
compute_mask_indices
called by 5
spiritlm/speech_tokenizer/hubert/hubert_model/wav2vec2_model.py
_upsample
called by 5
spiritlm/speech_tokenizer/hifigan/hifigan_vocoder.py
encode_units
called by 4
spiritlm/speech_tokenizer/spiritlm_tokenizer.py
assert_shape
called by 4
spiritlm/speech_tokenizer/f0/vqvae.py

Shape

Method 226
Function 88
Class 65
Route 1

Languages

Python100%

Modules by API surface

spiritlm/speech_tokenizer/hubert/hubert_model/wav2vec2_model.py149 symbols
spiritlm/speech_tokenizer/f0/vqvae.py49 symbols
spiritlm/speech_tokenizer/hifigan/hifigan_vocoder.py26 symbols
spiritlm/speech_tokenizer/hubert/hubert_model/hubert_model.py21 symbols
spiritlm/model/spiritlm_model.py20 symbols
spiritlm/speech_tokenizer/spiritlm_tokenizer.py13 symbols
spiritlm/speech_tokenizer/f0/f0_extractor.py13 symbols
spiritlm/speech_tokenizer/hubert/hubert_tokenizer.py11 symbols
spiritlm/eval/load_data.py8 symbols
tests/test_tokenizer.py7 symbols
spiritlm/speech_tokenizer/hubert/quantizer_model.py7 symbols
spiritlm/eval/stsp/utils.py7 symbols

For agents

$ claude mcp add spiritlm \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page