e2-tts-pytorch


Namee2-tts-pytorch JSON
Version 1.5.1 PyPI version JSON
download
home_pageNone
SummaryE2-TTS in Pytorch
upload_time2024-11-05 17:05:30
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2024 Phil Wang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords artificial intelligence attention mechanism deep learning text to speech transformers
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
<img src="./e2-tts.png" width="400px"></img>

## E2 TTS - Pytorch

Implementation of E2-TTS, <a href="https://arxiv.org/abs/2406.18009v1">Embarrassingly Easy Fully Non-Autoregressive Zero-Shot TTS</a>, in Pytorch

The repository differs from the paper in that it uses a <a href="https://arxiv.org/abs/2107.10342">multistream transformer</a> for text and audio, with conditioning done every transformer block in the E2 manner.

It also includes an improvisation that was proven out by Manmay, where the text is simply interpolated to the length of the audio for conditioning. You can try this by setting `interpolated_text = True` on `E2TTS`

## Appreciation

- <a href="https://github.com/manmay-nakhashi">Manmay</a> for contributing <a href="https://github.com/lucidrains/e2-tts-pytorch/pull/1">working end-to-end training code</a>!

- <a href="https://github.com/lucasnewman">Lucas Newman</a> for the code contributions, helpful feedback, and for sharing the first set of positive experiments!

- <a href="https://github.com/JingRH">Jing</a> for sharing the second positive result with a multilingual (English + Chinese) dataset!

- <a href="https://github.com/Coice">Coice</a> and <a href="https://github.com/manmay-nakhashi">Manmay</a> for reporting the third and fourth successful runs. Farewell alignment engineering

## Install

```bash
$ pip install e2-tts-pytorch
```

## Usage

```python
import torch

from e2_tts_pytorch import (
    E2TTS,
    DurationPredictor
)

duration_predictor = DurationPredictor(
    transformer = dict(
        dim = 512,
        depth = 8,
    )
)

mel = torch.randn(2, 1024, 100)
text = ['Hello', 'Goodbye']

loss = duration_predictor(mel, text = text)
loss.backward()

e2tts = E2TTS(
    duration_predictor = duration_predictor,
    transformer = dict(
        dim = 512,
        depth = 8        
    ),
)

out = e2tts(mel, text = text)
out.loss.backward()

sampled = e2tts.sample(mel[:, :5], text = text)

```

## Citations

```bibtex
@inproceedings{Eskimez2024E2TE,
    title   = {E2 TTS: Embarrassingly Easy Fully Non-Autoregressive Zero-Shot TTS},
    author  = {Sefik Emre Eskimez and Xiaofei Wang and Manthan Thakker and Canrun Li and Chung-Hsien Tsai and Zhen Xiao and Hemin Yang and Zirun Zhu and Min Tang and Xu Tan and Yanqing Liu and Sheng Zhao and Naoyuki Kanda},
    year    = {2024},
    url     = {https://api.semanticscholar.org/CorpusID:270738197}
}
```

```bibtex
@inproceedings{Darcet2023VisionTN,
    title   = {Vision Transformers Need Registers},
    author  = {Timoth'ee Darcet and Maxime Oquab and Julien Mairal and Piotr Bojanowski},
    year    = {2023},
    url     = {https://api.semanticscholar.org/CorpusID:263134283}
}
```

```bibtex
@article{Bao2022AllAW,
    title   = {All are Worth Words: A ViT Backbone for Diffusion Models},
    author  = {Fan Bao and Shen Nie and Kaiwen Xue and Yue Cao and Chongxuan Li and Hang Su and Jun Zhu},
    journal = {2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    year    = {2022},
    pages   = {22669-22679},
    url     = {https://api.semanticscholar.org/CorpusID:253581703}
}
```

```bibtex
@article{Burtsev2021MultiStreamT,
    title     = {Multi-Stream Transformers},
    author    = {Mikhail S. Burtsev and Anna Rumshisky},
    journal   = {ArXiv},
    year      = {2021},
    volume    = {abs/2107.10342},
    url       = {https://api.semanticscholar.org/CorpusID:236171087}
}
```

```bibtex
@inproceedings{Sadat2024EliminatingOA,
    title   = {Eliminating Oversaturation and Artifacts of High Guidance Scales in Diffusion Models},
    author  = {Seyedmorteza Sadat and Otmar Hilliges and Romann M. Weber},
    year    = {2024},
    url     = {https://api.semanticscholar.org/CorpusID:273098845}
}
```

```bibtex
@article{Gulati2020ConformerCT,
    title   = {Conformer: Convolution-augmented Transformer for Speech Recognition},
    author  = {Anmol Gulati and James Qin and Chung-Cheng Chiu and Niki Parmar and Yu Zhang and Jiahui Yu and Wei Han and Shibo Wang and Zhengdong Zhang and Yonghui Wu and Ruoming Pang},
    journal = {ArXiv},
    year    = {2020},
    volume  = {abs/2005.08100},
    url     = {https://api.semanticscholar.org/CorpusID:218674528}
}
```

```bibtex
@article{Yang2024ConsistencyFM,
    title   = {Consistency Flow Matching: Defining Straight Flows with Velocity Consistency},
    author  = {Ling Yang and Zixiang Zhang and Zhilong Zhang and Xingchao Liu and Minkai Xu and Wentao Zhang and Chenlin Meng and Stefano Ermon and Bin Cui},
    journal = {ArXiv},
    year    = {2024},
    volume  = {abs/2407.02398},
    url     = {https://api.semanticscholar.org/CorpusID:270878436}
}
```

```bibtex
@article{Li2024SwitchEA,
    title   = {Switch EMA: A Free Lunch for Better Flatness and Sharpness},
    author  = {Siyuan Li and Zicheng Liu and Juanxi Tian and Ge Wang and Zedong Wang and Weiyang Jin and Di Wu and Cheng Tan and Tao Lin and Yang Liu and Baigui Sun and Stan Z. Li},
    journal = {ArXiv},
    year    = {2024},
    volume  = {abs/2402.09240},
    url     = {https://api.semanticscholar.org/CorpusID:267657558}
}
```

```bibtex
@inproceedings{Zhou2024ValueRL,
    title   = {Value Residual Learning For Alleviating Attention Concentration In Transformers},
    author  = {Zhanchao Zhou and Tianyi Wu and Zhiyun Jiang and Zhenzhong Lan},
    year    = {2024},
    url     = {https://api.semanticscholar.org/CorpusID:273532030}
}
```

```bibtex
@inproceedings{Yao2024FasterDiTTF,
    title   = {FasterDiT: Towards Faster Diffusion Transformers Training without Architecture Modification},
    author  = {Jingfeng Yao and Wang Cheng and Wenyu Liu and Xinggang Wang},
    year    = {2024},
    url     = {https://api.semanticscholar.org/CorpusID:273346237}
}
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "e2-tts-pytorch",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "artificial intelligence, attention mechanism, deep learning, text to speech, transformers",
    "author": null,
    "author_email": "Phil Wang <lucidrains@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/2f/01/999cfcb265e07db8c79781af23452099e674b5704110b3982a7c0f2d8d87/e2_tts_pytorch-1.5.1.tar.gz",
    "platform": null,
    "description": "\n<img src=\"./e2-tts.png\" width=\"400px\"></img>\n\n## E2 TTS - Pytorch\n\nImplementation of E2-TTS, <a href=\"https://arxiv.org/abs/2406.18009v1\">Embarrassingly Easy Fully Non-Autoregressive Zero-Shot TTS</a>, in Pytorch\n\nThe repository differs from the paper in that it uses a <a href=\"https://arxiv.org/abs/2107.10342\">multistream transformer</a> for text and audio, with conditioning done every transformer block in the E2 manner.\n\nIt also includes an improvisation that was proven out by Manmay, where the text is simply interpolated to the length of the audio for conditioning. You can try this by setting `interpolated_text = True` on `E2TTS`\n\n## Appreciation\n\n- <a href=\"https://github.com/manmay-nakhashi\">Manmay</a> for contributing <a href=\"https://github.com/lucidrains/e2-tts-pytorch/pull/1\">working end-to-end training code</a>!\n\n- <a href=\"https://github.com/lucasnewman\">Lucas Newman</a> for the code contributions, helpful feedback, and for sharing the first set of positive experiments!\n\n- <a href=\"https://github.com/JingRH\">Jing</a> for sharing the second positive result with a multilingual (English + Chinese) dataset!\n\n- <a href=\"https://github.com/Coice\">Coice</a> and <a href=\"https://github.com/manmay-nakhashi\">Manmay</a> for reporting the third and fourth successful runs. Farewell alignment engineering\n\n## Install\n\n```bash\n$ pip install e2-tts-pytorch\n```\n\n## Usage\n\n```python\nimport torch\n\nfrom e2_tts_pytorch import (\n    E2TTS,\n    DurationPredictor\n)\n\nduration_predictor = DurationPredictor(\n    transformer = dict(\n        dim = 512,\n        depth = 8,\n    )\n)\n\nmel = torch.randn(2, 1024, 100)\ntext = ['Hello', 'Goodbye']\n\nloss = duration_predictor(mel, text = text)\nloss.backward()\n\ne2tts = E2TTS(\n    duration_predictor = duration_predictor,\n    transformer = dict(\n        dim = 512,\n        depth = 8        \n    ),\n)\n\nout = e2tts(mel, text = text)\nout.loss.backward()\n\nsampled = e2tts.sample(mel[:, :5], text = text)\n\n```\n\n## Citations\n\n```bibtex\n@inproceedings{Eskimez2024E2TE,\n    title   = {E2 TTS: Embarrassingly Easy Fully Non-Autoregressive Zero-Shot TTS},\n    author  = {Sefik Emre Eskimez and Xiaofei Wang and Manthan Thakker and Canrun Li and Chung-Hsien Tsai and Zhen Xiao and Hemin Yang and Zirun Zhu and Min Tang and Xu Tan and Yanqing Liu and Sheng Zhao and Naoyuki Kanda},\n    year    = {2024},\n    url     = {https://api.semanticscholar.org/CorpusID:270738197}\n}\n```\n\n```bibtex\n@inproceedings{Darcet2023VisionTN,\n    title   = {Vision Transformers Need Registers},\n    author  = {Timoth'ee Darcet and Maxime Oquab and Julien Mairal and Piotr Bojanowski},\n    year    = {2023},\n    url     = {https://api.semanticscholar.org/CorpusID:263134283}\n}\n```\n\n```bibtex\n@article{Bao2022AllAW,\n    title   = {All are Worth Words: A ViT Backbone for Diffusion Models},\n    author  = {Fan Bao and Shen Nie and Kaiwen Xue and Yue Cao and Chongxuan Li and Hang Su and Jun Zhu},\n    journal = {2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},\n    year    = {2022},\n    pages   = {22669-22679},\n    url     = {https://api.semanticscholar.org/CorpusID:253581703}\n}\n```\n\n```bibtex\n@article{Burtsev2021MultiStreamT,\n    title     = {Multi-Stream Transformers},\n    author    = {Mikhail S. Burtsev and Anna Rumshisky},\n    journal   = {ArXiv},\n    year      = {2021},\n    volume    = {abs/2107.10342},\n    url       = {https://api.semanticscholar.org/CorpusID:236171087}\n}\n```\n\n```bibtex\n@inproceedings{Sadat2024EliminatingOA,\n    title   = {Eliminating Oversaturation and Artifacts of High Guidance Scales in Diffusion Models},\n    author  = {Seyedmorteza Sadat and Otmar Hilliges and Romann M. Weber},\n    year    = {2024},\n    url     = {https://api.semanticscholar.org/CorpusID:273098845}\n}\n```\n\n```bibtex\n@article{Gulati2020ConformerCT,\n    title   = {Conformer: Convolution-augmented Transformer for Speech Recognition},\n    author  = {Anmol Gulati and James Qin and Chung-Cheng Chiu and Niki Parmar and Yu Zhang and Jiahui Yu and Wei Han and Shibo Wang and Zhengdong Zhang and Yonghui Wu and Ruoming Pang},\n    journal = {ArXiv},\n    year    = {2020},\n    volume  = {abs/2005.08100},\n    url     = {https://api.semanticscholar.org/CorpusID:218674528}\n}\n```\n\n```bibtex\n@article{Yang2024ConsistencyFM,\n    title   = {Consistency Flow Matching: Defining Straight Flows with Velocity Consistency},\n    author  = {Ling Yang and Zixiang Zhang and Zhilong Zhang and Xingchao Liu and Minkai Xu and Wentao Zhang and Chenlin Meng and Stefano Ermon and Bin Cui},\n    journal = {ArXiv},\n    year    = {2024},\n    volume  = {abs/2407.02398},\n    url     = {https://api.semanticscholar.org/CorpusID:270878436}\n}\n```\n\n```bibtex\n@article{Li2024SwitchEA,\n    title   = {Switch EMA: A Free Lunch for Better Flatness and Sharpness},\n    author  = {Siyuan Li and Zicheng Liu and Juanxi Tian and Ge Wang and Zedong Wang and Weiyang Jin and Di Wu and Cheng Tan and Tao Lin and Yang Liu and Baigui Sun and Stan Z. Li},\n    journal = {ArXiv},\n    year    = {2024},\n    volume  = {abs/2402.09240},\n    url     = {https://api.semanticscholar.org/CorpusID:267657558}\n}\n```\n\n```bibtex\n@inproceedings{Zhou2024ValueRL,\n    title   = {Value Residual Learning For Alleviating Attention Concentration In Transformers},\n    author  = {Zhanchao Zhou and Tianyi Wu and Zhiyun Jiang and Zhenzhong Lan},\n    year    = {2024},\n    url     = {https://api.semanticscholar.org/CorpusID:273532030}\n}\n```\n\n```bibtex\n@inproceedings{Yao2024FasterDiTTF,\n    title   = {FasterDiT: Towards Faster Diffusion Transformers Training without Architecture Modification},\n    author  = {Jingfeng Yao and Wang Cheng and Wenyu Liu and Xinggang Wang},\n    year    = {2024},\n    url     = {https://api.semanticscholar.org/CorpusID:273346237}\n}\n```\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Phil Wang  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "E2-TTS in Pytorch",
    "version": "1.5.1",
    "project_urls": {
        "Homepage": "https://pypi.org/project/e2-tts-pytorch/",
        "Repository": "https://github.com/lucidrains/e2-tts-pytorch"
    },
    "split_keywords": [
        "artificial intelligence",
        " attention mechanism",
        " deep learning",
        " text to speech",
        " transformers"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8b090a8258735fb3e11d3c11e8927ef1d38169910f6cf4cb2d1e93e86074141a",
                "md5": "e3441807b72803ebc55b8a5fe9e6e5eb",
                "sha256": "3f0df7585ed50cfff1cee356e6def8de07bedd02ef6fcca72ab2f84f3c051897"
            },
            "downloads": -1,
            "filename": "e2_tts_pytorch-1.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e3441807b72803ebc55b8a5fe9e6e5eb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 18235,
            "upload_time": "2024-11-05T17:05:29",
            "upload_time_iso_8601": "2024-11-05T17:05:29.312049Z",
            "url": "https://files.pythonhosted.org/packages/8b/09/0a8258735fb3e11d3c11e8927ef1d38169910f6cf4cb2d1e93e86074141a/e2_tts_pytorch-1.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2f01999cfcb265e07db8c79781af23452099e674b5704110b3982a7c0f2d8d87",
                "md5": "1c3b01c1c3256821919c4ea9d41d47af",
                "sha256": "a503d23bc3f6b98bc4eee5cef68d35b56c3c2ac27e5cb58bdaf78fec9e483bd2"
            },
            "downloads": -1,
            "filename": "e2_tts_pytorch-1.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1c3b01c1c3256821919c4ea9d41d47af",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 186198,
            "upload_time": "2024-11-05T17:05:30",
            "upload_time_iso_8601": "2024-11-05T17:05:30.389939Z",
            "url": "https://files.pythonhosted.org/packages/2f/01/999cfcb265e07db8c79781af23452099e674b5704110b3982a7c0f2d8d87/e2_tts_pytorch-1.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-05 17:05:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lucidrains",
    "github_project": "e2-tts-pytorch",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "e2-tts-pytorch"
}
        
Elapsed time: 0.39119s