39 Commits

Author SHA1 Message Date
Johnny Arcitec
cdcc62ae22
IndexTTS2 Release Preparation, Part 2 (#291)
* fix: Configure "uv" build system to use CUDA on supported platforms

- Linux builds of PyTorch always have CUDA acceleration built-in, but Windows only has it if we request a CUDA build.

- The built-in CUDA on Linux uses old libraries and can be slow.

- We now request PyTorch built for the most modern CUDA Toolkit on Linux + Windows, to solve both problems.

- Mac uses PyTorch without CUDA support, since it doesn't exist on that platform.

- Other dependencies have received new releases and are included in this fix too:

* click was downgraded because the author revoked 8.2.2 due to a bug.

* wetext received a new release now.

* fix: Use PyPI as the hashing reference in "uv" lockfile

- PyPI is the most trustworthy source for package hashes. We need to remove the custom mirror from the config, otherwise that mirror always becomes the default lockfile/package source, which leads to user trust issues and package impersonation risks.

- Regional mirrors should be added by users during installation instead, via the `uv sync --default-index` flag. Documented with example for Chinese mirror.

- When users add `--default-index`, "uv" will try to discover the exact same packages via the mirror to improve download speeds, but automatically uses PyPI if the mirror didn't have the files or if the mirror's file hashes were incorrect. Thus ensuring that users always have the correct package files.

* docs: Improve README for IndexTTS2 release!

- "Abstract" separated into paragraphs for easier readability.

- Clearer document structure and many grammatical improvements.

- More emojis, to make it easier to find sections when scrolling through the page!

- Added missing instructions:

* Needing `git-lfs` to clone the code.
* Needing CUDA Toolkit to install the dependencies.
* How to install the `hf` or `modelscope` CLI tools to download the models.

- Made our web demo the first section within "quickstart", to give users a quick, fun demo to start experimenting with.

- Fixed a bug in the "PYTHONPATH" recommendation. It must be enclosed in quotes `""`, otherwise the new path would break on systems that had spaces in their original path.

- Improved all Python code-example descriptions to make them much easier to understand.

- Clearly marked the IndexTTS1 legacy section as "legacy" to avoid confusion.

- Removed outdated Windows "conda/pip" instruction which is no longer relevant since we use "uv" now.

* refactor(webui): Remove unused imports

The old IndexTTS1 module and ModelScope were being loaded even though we don't need them. They also have a lot of dependencies, which slowed down loading and could even cause some conflicts.

* feat!: Remove obsolete build system (setup.py)

BREAKING CHANGE: The `setup.py` file has been removed.

Users should now use the new `pyproject.toml` based "uv" build system for installing and developing the project.

* feat: Add support for installing IndexTTS as a CLI tool

- We now support installing as a CLI tool via "uv".

- Uses the modern "hatchling" as the package / CLI build system.

- The `cli.py` code is currently outdated (doesn't support IndexTTS2). Marking as a TODO.

* chore: Add authors and classifiers metadata to pyproject.toml

* feat: Faster installs by making WebUI dependencies optional

* refactor!: Rename "sentences" to "segments" for clarity

- When we are splitting text into generation chunks, we are *not* creating "sentences". We are creating "segments". Because a *sentence* must always end with punctuation (".!?" etc). A *segment* can be a small fragment of a sentence, without any punctuation, so it's not accurate (and was very misleading) to use the word "sentences".

- All variables, function calls and strings have been carefully analyzed and renamed.

- This change will be part of user-facing code via a new feature, which is why the change was applied to the entire codebase.

- This change also helps future code contributors understand the code.

- All affected features are fully tested and work correctly after this refactoring.

- The `is_fp16` parameter has also been renamed to `use_fp16` since the previous name could confuse people ("is" implies an automatic check, "use" implies a user decision to enable/disable FP16).

- `cli.py`'s "--fp16" default value has been set to False, exactly like the web UI.

- `webui.py`'s "--is_fp16" flag has been changed to "--fp16" for easier usage and consistency with the CLI program, and the help-description has been improved.

* feat(webui): Set "max tokens per generation segment" via CLI flag

- The "Max tokens per generation segment" is a critical setting, as it directly impacts VRAM usage. Since the optimal value varies significantly based on a user's GPU, it is a frequent point of adjustment to prevent out-of-memory issues.

- This change allows the default value to be set via a CLI flag. Users can now conveniently start the web UI with the correct setting for their system, eliminating the need to manually reconfigure the value on every restart.

- The `webui.py -h` help text has also been enhanced to automatically display the default values for all CLI settings.

* refactor(i18n): Improve clarity of all web UI translation strings

* feat(webui): Use main text as emotion guidance when description is empty

If the user selects "text-to-emotion" control, but leaves the emotion description empty, we now automatically use the main text prompt instead.

This ensures that web users can enjoy every feature of IndexTTS2, including the ability to automatically guess the emotion from the main text prompt.

* feat: Add PyTorch GPU acceleration diagnostic tool

* chore: Use NVIDIA CUDA Toolkit v12.8

Downgrade from CUDA 12.9 to 12.8 to simplify user installation, since version 12.8 is very popular.

* docs: Simplify "uv run" command examples

The "uv run" command can take a `.py` file as direct argument and automatically understands that it should run via python.
2025-09-09 12:51:45 +08:00
kemuriririn
72c09ec0b7
Indextts2 (#276)
* indextts2

* update lfs for audio files

---------

Co-authored-by: wangyining02 <wangyining02@bilibili.com>
2025-09-08 17:36:39 +08:00
yrom
92bb2eb0c0 fix: 避免在 MinGW-w64 环境 jit compile cuda ext 2025-05-29 09:01:56 +08:00
yrom
59c05c0765
fix: add force_rebuild flag for fused alias_free_activation and update installation instructions 2025-05-23 15:07:39 +08:00
yrom
60a2238eac sample_kwargs 替换为 generation_kwargs 2025-05-18 19:34:41 +08:00
yrom
96d3b75708 添加警告提示:生成停止因超出 max_mel_tokens 限制 2025-05-18 19:34:41 +08:00
yrom
7e52976bd1 删除测试代码 2025-05-18 19:34:41 +08:00
yrom
22eeb7625f 修正attention mask和positional embeddings
- 将之前只有text右侧填充改为cond+text 整体左侧填充
- 添加填充测试用例
2025-05-18 19:34:32 +08:00
yrom
a50cb8c287 优化文本掩码填充逻辑,改进句子桶化处理 2025-05-17 20:59:07 +08:00
yrom
4de7611bda fix 批量推理1.5版本模型问题,调整分句逻辑和参数设置
- 将pad 改为全 eos token
- 优化bucket_sentences 算法
2025-05-17 14:40:01 +08:00
Yrom
35b6514ee5
Enhance text normalization and tokenization
- Introduced `de_tokenized_by_CJK_char` for restoring original text from tokenized format.
- Added `TextTokenizer` class for improved tokenization, including sentence splitting and handling of special tokens.
- Enhanced `TextNormalizer` to handle names and pinyin tones with placeholder mechanisms.
- Added regression tests for new features in `regression_test.py`.
2025-04-24 20:28:44 +08:00
Yrom
dd2b7dd820
Fix autocast device type for compatibility 2025-04-24 11:00:49 +08:00
sunnyboxs
3fc7b31e10 单句推理:RTF性能至少提升 10% 2025-04-20 14:12:38 +08:00
kemuriririn
a26894de71
+回归测试脚本 (#103)
* deepspeed无法使用时回退到通常路径

* ninja支持中文路径编译补丁:BigVGAN fused cuda kernel

* 缓存参考音频的Mel

* ninja支持中文路径编译方案2:BigVGAN fused cuda kernel

* 增加批次推理:长句实现至少 2~10 倍以上的速度提升~

* fix上层目录为空时报错

* 批次推理:重要修复(漏句/丢句/音频空白)

* 批次推理:新增数据分桶机制,增强稳定性~

* +回归测试脚本

* update 回归测试脚本

* fix merge出错

---------

Co-authored-by: kemuriririn <10inspiral@gmail.com>
Co-authored-by: sunnyboxs <sjt2000@qq.com>
2025-04-18 18:09:13 +08:00
sunnyboxs
71c5295198
批次推理:修复(漏句/丢句/音频空白) (#100)
* 批次推理:重要修复(漏句/丢句/音频空白)

* 批次推理:新增数据分桶机制,增强稳定性~
2025-04-18 17:57:07 +08:00
kemuriririn
6783f22fe4
Feature/kemurin (#99)
* deepspeed无法使用时回退到通常路径

* ninja支持中文路径编译补丁:BigVGAN fused cuda kernel

* 缓存参考音频的Mel

* ninja支持中文路径编译方案2:BigVGAN fused cuda kernel

* 增加批次推理:长句实现至少 2~10 倍以上的速度提升~

* fix上层目录为空时报错

---------

Co-authored-by: kemuriririn <10inspiral@gmail.com>
Co-authored-by: sunnyboxs <sjt2000@qq.com>
2025-04-17 15:12:45 +08:00
sunnyboxs
91b7fa6148
ninja中文路径编译补丁支持:BigVGAN fused cuda kernel (#93)
* ninja支持中文路径编译补丁:BigVGAN fused cuda kernel

* 缓存参考音频的Mel

* ninja支持中文路径编译方案2:BigVGAN fused cuda kernel
2025-04-17 14:56:37 +08:00
root
b6c11dddb9 Add the calculation time of each module. 2025-04-15 12:48:47 +08:00
Yrom
94d1353e4e
enable custom cuda kernel for BigVGAN 2025-04-15 12:04:59 +08:00
kemuriririn
21a3212a34
deepspeed无法使用时回退到通常路径 (#90)
Co-authored-by: kemuriririn <10inspiral@gmail.com>
2025-04-14 20:22:57 +08:00
Yrom Wang
18c32c06b1
修复拼音问题和分句问题,支持轻音声调(如yi1 shang5) (#83)
* Update Pinyin tone handling in TextNormalizer

* Enhance sentence splitting and improve tokenizer integration in inference

* Update character replacement mappings

test: "在电影《肖申克的救赎》中,安迪·杜佛兰被错误地判处终身监禁..."

* Refactor TextNormalizer and enhance testing with additional cases
2025-04-14 19:50:36 +08:00
Yrom
879e270d39
Adds MPS support for Apple Silicon 2025-04-11 21:22:08 +08:00
Yrom
ec65755fc8
Support inference on CPU 2025-04-11 20:58:41 +08:00
root
eff6eb8f43 fix bug. 2025-04-10 10:52:59 +08:00
root
702cfa905c fix long silence bug. 2025-04-09 19:53:36 +08:00
root
999cf40258 fix long silence bug. 2025-04-09 19:52:49 +08:00
root
47ec591d40 fix long silence bug. 2025-04-09 19:45:18 +08:00
shujingchen
058be6f799 Merge from main 2025-04-09 12:02:28 +08:00
root
19be5dba2d fix bug. 2025-04-09 10:38:51 +08:00
root
ae395dc416 cleanup code 2025-04-08 11:54:31 +08:00
boostpapa
2523001bb4 support ultra-long silence filtering 2025-04-08 11:23:11 +08:00
shujingchen
e92bf90235 DeepSpeed acceleration and FP16 inference support, but bigvgan disable 2025-04-03 16:30:39 +08:00
kemuriririn
6286b0ffc9 推理时加载bpe model使用相对于模型根目录的路径 2025-04-02 17:40:41 +08:00
wangyining02
1004452e95 WeTextProcessing: overwrite_cache=True 刷新前端缓存 2025-03-26 20:29:12 +08:00
wangyining02
46630ca45b +简单前端 2025-03-26 19:14:47 +08:00
wangyining02
de60f6829b Merge branch 'main' of github.com:eschmidbauer/index-tts into eschmidbauer-main 2025-03-26 12:46:19 +08:00
wangyining02
b591e84bf9 rename utils.utils to utils.common 2025-03-26 12:15:48 +08:00
Emmanuel Schmidbauer
2fe6a73ada fix packages 2025-03-25 14:03:29 -04:00
wangyining02
8db92eda8c init infer code 2025-03-25 12:52:52 +08:00