spear tts pytorch
0.4.8
在 Pytorch 實現 Spear-TTS - 多說話者文字轉語音注意網絡
這裡建構的文本到語義模組將用於 SoundStorm 進行調節。
他們慷慨的贊助工作和開源尖端人工智慧研究的穩定性
Lucas Newman 完成了反向翻譯部分以及波束搜尋解碼!
Lucas Newman 完成了最終文字到語意轉換器的訓練程式碼!
$ pip install spear-tts-pytorch
import torch
from audiolm_pytorch import HubertWithKmeans
from spear_tts_pytorch import (
TextToSemantic ,
SemanticToTextDatasetGenerator ,
GeneratedAudioTextDataset ,
MockDataset
)
wav2vec = HubertWithKmeans (
checkpoint_path = './hubert_base_ls960.pt' ,
kmeans_path = './hubert_base_ls960_L9_km500.bin'
)
model = TextToSemantic (
wav2vec = wav2vec ,
dim = 512 ,
num_text_token_ids = 256 ,
heads = 8 ,
target_kv_heads = 2 , # grouped query attention, for memory efficient decoding
source_depth = 1 ,
target_depth = 1
)
ds = MockDataset ( 10 )
dataset_generator = SemanticToTextDatasetGenerator (
model = model ,
dataset = ds ,
folder = './output_folder'
)
dataset_generator ( max_length = 2 )
generated_dataset = GeneratedAudioTextDataset (
folder = './output_folder'
)
assert len ( generated_dataset ) == 10
新增 eos 邏輯 + 生成,並在 soundstorm 中連接端對端生成
加入第一個預訓練語音到語音,重建 60% 已刪除的標記
由於資源匱乏,為此計畫增加輟學者
增加訓練期間凍結編碼器/解碼器層的整體靈活性
新增小語音訓練步驟 -> 文字語料庫並產生偽標記資料集 + 微調(感謝@lucasnewman)
新增對文字 -> 語音 + 偽標籤資料集進行微調的最後一步
找出儲存和管理偽標籤生成資料集的最佳方法
批次波束搜尋解碼
允許在解碼器中使用旋轉位置+閃光注意,給Tri另一個引用
將推測性解碼與一些即興創作相結合 - 使用早期退出策略在同一模型中完成
為 starter + 單一/分組鍵值新增快取的鍵/值,確保在 Flash Attention 2 進入 pytorch 核心之前 Flash Attention 可以支援專門的因果掩碼
完善音訊文字產生工作流程
將真實的音訊文字資料集與產生的資料集連接起來 -> 或能夠將真實的音訊文字資料集轉換為產生的資料集
@misc { kharitonov2023speak ,
title = { Speak, Read and Prompt: High-Fidelity Text-to-Speech with Minimal Supervision } ,
author = { Eugene Kharitonov and Damien Vincent and Zalán Borsos and Raphaël Marinier and Sertan Girgin and Olivier Pietquin and Matt Sharifi and Marco Tagliasacchi and Neil Zeghidour } ,
year = { 2023 } ,
eprint = { 2302.03540 } ,
archivePrefix = { arXiv } ,
primaryClass = { cs.SD }
}
@inproceedings { dao2022flashattention ,
title = { Flash{A}ttention: Fast and Memory-Efficient Exact Attention with {IO}-Awareness } ,
author = { Dao, Tri and Fu, Daniel Y. and Ermon, Stefano and Rudra, Atri and R{'e}, Christopher } ,
booktitle = { Advances in Neural Information Processing Systems } ,
year = { 2022 }
}
@misc { shi2023enhance ,
title = { Enhance audio generation controllability through representation similarity regularization } ,
author = { Yangyang Shi and Gael Le Lan and Varun Nagaraja and Zhaoheng Ni and Xinhao Mei and Ernie Chang and Forrest Iandola and Yang Liu and Vikas Chandra } ,
year = { 2023 } ,
eprint = { 2309.08773 } ,
archivePrefix = { arXiv } ,
primaryClass = { cs.SD }
}
@article { Ainslie2023GQATG ,
title = { GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpoints } ,
author = { Joshua Ainslie and James Lee-Thorp and Michiel de Jong and Yury Zemlyanskiy and Federico Lebr'on and Sumit K. Sanghai } ,
journal = { ArXiv } ,
year = { 2023 } ,
volume = { abs/2305.13245 } ,
url = { https://api.semanticscholar.org/CorpusID:258833177 }
}
@inproceedings { Leviathan2022FastIF ,
title = { Fast Inference from Transformers via Speculative Decoding } ,
author = { Yaniv Leviathan and Matan Kalman and Y. Matias } ,
booktitle = { International Conference on Machine Learning } ,
year = { 2022 } ,
url = { https://api.semanticscholar.org/CorpusID:254096365 }
}