Safetensors
llama
mzboito commited on
Commit
a706609
·
verified ·
1 Parent(s): 5292833

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +60 -1
README.md CHANGED
@@ -11,4 +11,63 @@ language:
11
  - nl
12
  - ru
13
  - zh
14
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  - nl
12
  - ru
13
  - zh
14
+ ---
15
+
16
+ # SpireLM
17
+ Spire is a 7B parameter decoder-only model with strong abilities in machine translation, automatic speech recognition, and speech translation. [SpireBase](https://huggingface.co/utter-project/SpireBase) was created by applying speech-centric continued pretraining to [TowerBase-7B-v0.1](https://huggingface.co/Unbabel/TowerBase-7B-v0.1), which was itself created by applying continued pretraining to [Llama 2](https://huggingface.co/meta-llama/Llama-2-7b).
18
+
19
+ ## Model Checkpoints
20
+ We release our checkpoints through Hugging Face. All of our models can be loaded as `LlamaForCausalLM` instances, allowing inference to be performed with [vLLM](https://github.com/vllm-project/vllm). For further details on the models, check [the paper](https://arxiv.org/abs/2503.10620).
21
+
22
+ | Model | Path |
23
+ | ----- | ---- |
24
+ | SpireBase | [utter-project/SpireBase](https://huggingface.co/utter-project/SpireBase) |
25
+ | SpireFull | [utter-project/SpireFull](https://huggingface.co/utter-project/SpireFull) |
26
+ | SpireNoBlocks | [utter-project/SpireNoBlocks](https://huggingface.co/utter-project/SpireNoBlocks) |
27
+ | SpireNoPseudo | [utter-project/SpireNoBlocks](https://huggingface.co/utter-project/SpireNoPseudo) |
28
+ | TowerFull | [utter-project/TowerFull](https://huggingface.co/utter-project/TowerFull) |
29
+
30
+ ## Tokenizing Speech
31
+ The core of our approach to speech is *discretization* - continuous speech signals are converted into sequences of tokens, which can then be processed alongside text. Our discretization system consists of a few steps:
32
+
33
+ 1. HuBERT Large ([fairseq download](https://dl.fbaipublicfiles.com/hubert/hubert_large_ll60k.pt)) converts 16kHz .wav files into into a sequence of feature vectors, one for each 20ms frame. We use the representations from layer 22.
34
+ 2. Our k-means model ([download](https://huggingface.co/utter-project/SpireKMeans/resolve/main/kmeans_model)) maps each frame to one of 5000 clusters.
35
+ 3. The sequences of cluster IDs are deduplicated, such that consecutive frames with the same label are collapsed into a single token. This usually shortens the sequence length by about 30%.
36
+
37
+ The `spire` package implements this pipeline. Assuming you have downloaded both of these files, you can use it like so:
38
+
39
+ ```
40
+ from datasets import load_dataset
41
+ from spire.dsus import Labeler
42
+ from spire.utils import fix_fleurs_path
43
+
44
+ fleurs = load_dataset("google/fleurs", "en_us")
45
+ wav = fix_fleurs_path(fleurs["validation"][29], "validation")
46
+
47
+ labeler = Labeler("hubert_large_ll60k.pt", "kmeans_model")
48
+ speech_tokens = labeler.label(wav)
49
+ print(speech_tokens)
50
+ ```
51
+
52
+ The output will not be very readable, as it consists of a sequence of Unicode [private use area](https://en.wikipedia.org/wiki/Private_Use_Areas) characters. However, these characters are known to the Spire tokenizer and can be combined with text:
53
+
54
+ TODO: add ASR/ST examples with this sequence
55
+
56
+ ## Reproducing our Inference Results
57
+ TODO: ducttape example
58
+
59
+ ## Reproducing our Training
60
+
61
+ ## Citation
62
+ If you use Spire, please cite our work:
63
+ ```
64
+ @misc{spire,
65
+ title={From TOWER to SPIRE: Adding the Speech Modality to a Text-Only LLM},
66
+ author={Kshitij Ambilduke and Ben Peters and Sonal Sannigrahi and Anil Keshwani and Tsz Kin Lam and Bruno Martins and Marcely Zanon Boito and André F. T. Martins},
67
+ year={2025},
68
+ eprint={2503.10620},
69
+ archivePrefix={arXiv},
70
+ primaryClass={cs.CL},
71
+ url={https://arxiv.org/abs/2503.10620}
72
+ }
73
+ ```