videopython-chatterbox 0.1.7.post2__tar.gz → 0.1.7.post3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/NOTICE +5 -3
  2. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/PKG-INFO +20 -22
  3. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/README.md +19 -19
  4. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/pyproject.toml +1 -8
  5. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/mtl_tts.py +1 -5
  6. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/tts.py +1 -5
  7. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/tts_turbo.py +1 -5
  8. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/vc.py +1 -5
  9. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/.gitignore +0 -0
  10. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/LICENSE +0 -0
  11. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/__init__.py +0 -0
  12. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/__init__.py +0 -0
  13. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/__init__.py +0 -0
  14. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/configs.py +0 -0
  15. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/const.py +0 -0
  16. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/decoder.py +0 -0
  17. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/f0_predictor.py +0 -0
  18. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/flow.py +0 -0
  19. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/flow_matching.py +0 -0
  20. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/hifigan.py +0 -0
  21. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/matcha/decoder.py +0 -0
  22. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/matcha/flow_matching.py +0 -0
  23. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/matcha/text_encoder.py +0 -0
  24. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/matcha/transformer.py +0 -0
  25. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/s3gen.py +0 -0
  26. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/transformer/__init__.py +0 -0
  27. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/transformer/activation.py +0 -0
  28. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/transformer/attention.py +0 -0
  29. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/transformer/convolution.py +0 -0
  30. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/transformer/embedding.py +0 -0
  31. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/transformer/encoder_layer.py +0 -0
  32. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/transformer/positionwise_feed_forward.py +0 -0
  33. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/transformer/subsampling.py +0 -0
  34. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/transformer/upsample_encoder.py +0 -0
  35. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/utils/class_utils.py +0 -0
  36. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/utils/intmeanflow.py +0 -0
  37. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/utils/mask.py +0 -0
  38. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/utils/mel.py +0 -0
  39. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3gen/xvector.py +0 -0
  40. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3tokenizer/__init__.py +0 -0
  41. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/s3tokenizer/s3tokenizer.py +0 -0
  42. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/t3/__init__.py +0 -0
  43. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/t3/inference/alignment_stream_analyzer.py +0 -0
  44. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/t3/inference/t3_hf_backend.py +0 -0
  45. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/t3/llama_configs.py +0 -0
  46. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/t3/modules/cond_enc.py +0 -0
  47. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/t3/modules/learned_pos_emb.py +0 -0
  48. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/t3/modules/perceiver.py +0 -0
  49. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/t3/modules/t3_config.py +0 -0
  50. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/t3/t3.py +0 -0
  51. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/tokenizers/__init__.py +0 -0
  52. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/tokenizers/tokenizer.py +0 -0
  53. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/utils.py +0 -0
  54. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/voice_encoder/__init__.py +0 -0
  55. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/voice_encoder/config.py +0 -0
  56. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/voice_encoder/melspec.py +0 -0
  57. {videopython_chatterbox-0.1.7.post2 → videopython_chatterbox-0.1.7.post3}/src/chatterbox/models/voice_encoder/voice_encoder.py +0 -0
@@ -6,8 +6,7 @@ This distribution is a fork of `chatterbox-tts` 0.1.7 by Resemble AI:
6
6
  https://github.com/resemble-ai/chatterbox
7
7
  https://pypi.org/project/chatterbox-tts/
8
8
 
9
- The Python source under `src/chatterbox/` is redistributed unchanged from
10
- upstream 0.1.7 with two small changes. First, in `src/chatterbox/__init__.py`:
9
+ The Python source under `src/chatterbox/` is based on upstream 0.1.7. First, in `src/chatterbox/__init__.py`:
11
10
 
12
11
  -__version__ = version("chatterbox-tts")
13
12
  +__version__ = version("videopython-chatterbox")
@@ -21,7 +20,10 @@ Second, in `src/chatterbox/models/t3/inference/alignment_stream_analyzer.py`,
21
20
  alignment-repetition detection is gated on S > 5. With five or fewer text
22
21
  tokens there are no earlier tokens to reduce, and the upstream expression
23
22
  raises an empty-reduction IndexError. Long-tail and generated-token repetition
24
- checks remain active. Other runtime source files are unchanged.
23
+ checks remain active.
24
+
25
+ Third, standard, multilingual and Turbo TTS and voice conversion return the
26
+ synthesized waveform directly. This fork removes the Perth audio watermark.
25
27
 
26
28
  The fork also changes dependency metadata and adds regression tests (see
27
29
  README.md for the rationale and verification).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: videopython-chatterbox
3
- Version: 0.1.7.post2
3
+ Version: 0.1.7.post3
4
4
  Summary: Chatterbox TTS (Resemble AI) with corrected dependency metadata. Includes a short-text alignment fix.
5
5
  Project-URL: Homepage, https://github.com/BartWojtowicz/videopython-chatterbox
6
6
  Project-URL: Repository, https://github.com/BartWojtowicz/videopython-chatterbox
@@ -42,10 +42,8 @@ Requires-Dist: numpy>=1.24.0
42
42
  Requires-Dist: omegaconf
43
43
  Requires-Dist: pykakasi>=2.3.0
44
44
  Requires-Dist: pyloudnorm
45
- Requires-Dist: resemble-perth>=1.0.0
46
45
  Requires-Dist: s3tokenizer
47
46
  Requires-Dist: safetensors>=0.5.3
48
- Requires-Dist: setuptools<81
49
47
  Requires-Dist: spacy-pkuseg
50
48
  Requires-Dist: torch>=2.6.0
51
49
  Requires-Dist: torchaudio>=2.6.0
@@ -56,11 +54,12 @@ Description-Content-Type: text/markdown
56
54
 
57
55
  [Chatterbox TTS](https://github.com/resemble-ai/chatterbox) by Resemble AI, republished with corrected dependency metadata.
58
56
 
59
- Version 0.1.7.post2 also fixes short-text alignment: repetition detection now
60
- checks that earlier text tokens exist before reducing their attention scores.
61
- Inputs with five or fewer text tokens retain long-tail and token-repetition EOS
62
- checks without raising an empty-reduction error. The distribution-name lookup
63
- and corrected dependency metadata remain the other changes from upstream 0.1.7.
57
+ Version 0.1.7.post3 returns unwatermarked audio from standard, multilingual and
58
+ Turbo speech synthesis and from voice conversion. Each generator returns a CPU
59
+ float32 tensor with one channel at 24 kHz. Applications that rely on Perth for
60
+ audio provenance must account for this change before upgrading.
61
+
62
+ The fork retains the short-text alignment fix introduced in 0.1.7.post2.
64
63
 
65
64
  ```bash
66
65
  pip install videopython-chatterbox
@@ -95,7 +94,14 @@ still exist and behave identically in diffusers 0.39.
95
94
 
96
95
  ## Verification
97
96
 
98
- Real synthesis and voice cloning were run on
97
+ The 0.1.7.post3 wheel passed all 11 tests in a clean Python 3.12 environment
98
+ on macOS with setuptools 84.2.1 and Perth absent. Standard English TTS generated
99
+ “The package is ready for testing.” Voice conversion then processed that output.
100
+ Both returned 41,280 mono float32 samples at 24 kHz, matching the vocoder samples
101
+ exactly. Whisper base.en transcribed the sentence correctly from both files.
102
+ Multilingual and Turbo output paths were checked with a test vocoder.
103
+
104
+ Earlier verification of synthesis and voice cloning ran on
99
105
  **torch 2.13.0 / diffusers 0.39.0 / transformers 5.14.1 / numpy 2.4.6**, then
100
106
  repeated under upstream's pinned `transformers==5.2.0`, with fixed seeds:
101
107
 
@@ -123,30 +129,22 @@ non-silent.
123
129
  | `safetensors` | `==0.5.3` | `>=0.5.3` | verified on 0.8.0 |
124
130
  | `pykakasi` | `==2.3.0` | `>=2.3.0` | 2.3.0 is still latest |
125
131
  | `gradio` | `==6.8.0` | *removed* | not imported anywhere in the package |
126
- | `setuptools` | *undeclared* | `<81` | see below |
127
-
128
- Two of these are deliberate constraints rather than relaxations:
132
+ | `resemble-perth` | `>=1.0.0` | *removed* | the generators return the vocoder output directly |
129
133
 
130
134
  **`diffusers<1.0`** — `LoRACompatibleLinear` is deprecated with removal
131
- scheduled for diffusers 1.0.0. It is the one symbol that will genuinely break,
132
- so the cap is real.
135
+ scheduled for diffusers 1.0.0.
133
136
 
134
- **`setuptools<81`** — `resemble-perth` declares no dependencies at all and
135
- imports `pkg_resources`, which setuptools removed in 82+. Its `__init__.py`
136
- swallows the resulting `ImportError` and sets `PerthImplicitWatermarker = None`,
137
- so chatterbox fails later at model load with a confusing
138
- `TypeError: 'NoneType' object is not callable`. Upstream is affected by this
139
- too; it is simply undeclared there.
137
+ Removing Perth also removes the fork’s runtime requirement for `setuptools<81`.
140
138
 
141
139
  ## Relationship to upstream
142
140
 
143
- Changes are limited to packaging compatibility and the documented short-text
144
- alignment crash fix. If upstream incorporates these fixes and relaxes its pins,
141
+ The fork changes packaging metadata, short-text alignment, and audio watermarking. If upstream incorporates these fixes and relaxes its pins,
145
142
  prefer `chatterbox-tts`.
146
143
 
147
144
  To rebase onto a new upstream release: replace `src/chatterbox/` wholesale,
148
145
  re-apply the distribution-name lookup in `chatterbox/__init__.py`, and check
149
146
  whether the short-text alignment fix is already present before carrying it forward.
147
+ Check the output path in all four generators for changes to watermarking.
150
148
  Run `python -m pytest tests/test_short_alignment.py`, verify the remaining source
151
149
  against the new sdist, bump `version` to `<upstream>.postN`, and re-check the
152
150
  dependency table above.
@@ -2,11 +2,12 @@
2
2
 
3
3
  [Chatterbox TTS](https://github.com/resemble-ai/chatterbox) by Resemble AI, republished with corrected dependency metadata.
4
4
 
5
- Version 0.1.7.post2 also fixes short-text alignment: repetition detection now
6
- checks that earlier text tokens exist before reducing their attention scores.
7
- Inputs with five or fewer text tokens retain long-tail and token-repetition EOS
8
- checks without raising an empty-reduction error. The distribution-name lookup
9
- and corrected dependency metadata remain the other changes from upstream 0.1.7.
5
+ Version 0.1.7.post3 returns unwatermarked audio from standard, multilingual and
6
+ Turbo speech synthesis and from voice conversion. Each generator returns a CPU
7
+ float32 tensor with one channel at 24 kHz. Applications that rely on Perth for
8
+ audio provenance must account for this change before upgrading.
9
+
10
+ The fork retains the short-text alignment fix introduced in 0.1.7.post2.
10
11
 
11
12
  ```bash
12
13
  pip install videopython-chatterbox
@@ -41,7 +42,14 @@ still exist and behave identically in diffusers 0.39.
41
42
 
42
43
  ## Verification
43
44
 
44
- Real synthesis and voice cloning were run on
45
+ The 0.1.7.post3 wheel passed all 11 tests in a clean Python 3.12 environment
46
+ on macOS with setuptools 84.2.1 and Perth absent. Standard English TTS generated
47
+ “The package is ready for testing.” Voice conversion then processed that output.
48
+ Both returned 41,280 mono float32 samples at 24 kHz, matching the vocoder samples
49
+ exactly. Whisper base.en transcribed the sentence correctly from both files.
50
+ Multilingual and Turbo output paths were checked with a test vocoder.
51
+
52
+ Earlier verification of synthesis and voice cloning ran on
45
53
  **torch 2.13.0 / diffusers 0.39.0 / transformers 5.14.1 / numpy 2.4.6**, then
46
54
  repeated under upstream's pinned `transformers==5.2.0`, with fixed seeds:
47
55
 
@@ -69,30 +77,22 @@ non-silent.
69
77
  | `safetensors` | `==0.5.3` | `>=0.5.3` | verified on 0.8.0 |
70
78
  | `pykakasi` | `==2.3.0` | `>=2.3.0` | 2.3.0 is still latest |
71
79
  | `gradio` | `==6.8.0` | *removed* | not imported anywhere in the package |
72
- | `setuptools` | *undeclared* | `<81` | see below |
73
-
74
- Two of these are deliberate constraints rather than relaxations:
80
+ | `resemble-perth` | `>=1.0.0` | *removed* | the generators return the vocoder output directly |
75
81
 
76
82
  **`diffusers<1.0`** — `LoRACompatibleLinear` is deprecated with removal
77
- scheduled for diffusers 1.0.0. It is the one symbol that will genuinely break,
78
- so the cap is real.
83
+ scheduled for diffusers 1.0.0.
79
84
 
80
- **`setuptools<81`** — `resemble-perth` declares no dependencies at all and
81
- imports `pkg_resources`, which setuptools removed in 82+. Its `__init__.py`
82
- swallows the resulting `ImportError` and sets `PerthImplicitWatermarker = None`,
83
- so chatterbox fails later at model load with a confusing
84
- `TypeError: 'NoneType' object is not callable`. Upstream is affected by this
85
- too; it is simply undeclared there.
85
+ Removing Perth also removes the fork’s runtime requirement for `setuptools<81`.
86
86
 
87
87
  ## Relationship to upstream
88
88
 
89
- Changes are limited to packaging compatibility and the documented short-text
90
- alignment crash fix. If upstream incorporates these fixes and relaxes its pins,
89
+ The fork changes packaging metadata, short-text alignment, and audio watermarking. If upstream incorporates these fixes and relaxes its pins,
91
90
  prefer `chatterbox-tts`.
92
91
 
93
92
  To rebase onto a new upstream release: replace `src/chatterbox/` wholesale,
94
93
  re-apply the distribution-name lookup in `chatterbox/__init__.py`, and check
95
94
  whether the short-text alignment fix is already present before carrying it forward.
95
+ Check the output path in all four generators for changes to watermarking.
96
96
  Run `python -m pytest tests/test_short_alignment.py`, verify the remaining source
97
97
  against the new sdist, bump `version` to `<upstream>.postN`, and re-check the
98
98
  dependency table above.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "videopython-chatterbox"
3
- version = "0.1.7.post2"
3
+ version = "0.1.7.post3"
4
4
  description = "Chatterbox TTS (Resemble AI) with corrected dependency metadata. Includes a short-text alignment fix."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -31,19 +31,12 @@ dependencies = [
31
31
  # (9 symbols, all still present in 0.39). The <1.0 cap IS load-bearing:
32
32
  # LoRACompatibleLinear is deprecated for removal in diffusers 1.0.0.
33
33
  "diffusers>=0.29.0,<1.0",
34
- "resemble-perth>=1.0.0",
35
34
  "conformer>=0.3.2", # upstream: ==0.3.2
36
35
  "safetensors>=0.5.3", # upstream: ==0.5.3
37
36
  "spacy-pkuseg",
38
37
  "pykakasi>=2.3.0", # upstream: ==2.3.0
39
38
  "pyloudnorm",
40
39
  "omegaconf",
41
- # Not declared upstream, but required: resemble-perth declares no
42
- # dependencies at all and imports pkg_resources, which setuptools removed in
43
- # 82+. perth/__init__.py swallows the ImportError and sets
44
- # PerthImplicitWatermarker = None, so chatterbox fails at model load with a
45
- # confusing `TypeError: 'NoneType' object is not callable` instead.
46
- "setuptools<81",
47
40
  ]
48
41
  # gradio==6.8.0 is intentionally dropped: it is not imported anywhere in the
49
42
  # shipped package (it backs upstream's demo app, which this fork does not ship).
@@ -4,7 +4,6 @@ import os
4
4
 
5
5
  import librosa
6
6
  import torch
7
- import perth
8
7
  import torch.nn.functional as F
9
8
  from safetensors.torch import load_file as load_safetensors
10
9
  from huggingface_hub import snapshot_download
@@ -152,7 +151,6 @@ class ChatterboxMultilingualTTS:
152
151
  self.tokenizer = tokenizer
153
152
  self.device = device
154
153
  self.conds = conds
155
- self.watermarker = perth.PerthImplicitWatermarker()
156
154
 
157
155
  @classmethod
158
156
  def get_supported_languages(cls):
@@ -312,6 +310,4 @@ class ChatterboxMultilingualTTS:
312
310
  speech_tokens=speech_tokens,
313
311
  ref_dict=self.conds.gen,
314
312
  )
315
- wav = wav.squeeze(0).detach().cpu().numpy()
316
- watermarked_wav = self.watermarker.apply_watermark(wav, sample_rate=self.sr)
317
- return torch.from_numpy(watermarked_wav).unsqueeze(0)
313
+ return wav.detach().to(device="cpu", dtype=torch.float32, copy=True)
@@ -3,7 +3,6 @@ from pathlib import Path
3
3
 
4
4
  import librosa
5
5
  import torch
6
- import perth
7
6
  import torch.nn.functional as F
8
7
  from huggingface_hub import hf_hub_download
9
8
  from safetensors.torch import load_file
@@ -123,7 +122,6 @@ class ChatterboxTTS:
123
122
  self.tokenizer = tokenizer
124
123
  self.device = device
125
124
  self.conds = conds
126
- self.watermarker = perth.PerthImplicitWatermarker()
127
125
 
128
126
  @classmethod
129
127
  def from_local(cls, ckpt_dir, device) -> 'ChatterboxTTS':
@@ -267,6 +265,4 @@ class ChatterboxTTS:
267
265
  speech_tokens=speech_tokens,
268
266
  ref_dict=self.conds.gen,
269
267
  )
270
- wav = wav.squeeze(0).detach().cpu().numpy()
271
- watermarked_wav = self.watermarker.apply_watermark(wav, sample_rate=self.sr)
272
- return torch.from_numpy(watermarked_wav).unsqueeze(0)
268
+ return wav.detach().to(device="cpu", dtype=torch.float32, copy=True)
@@ -5,7 +5,6 @@ from pathlib import Path
5
5
 
6
6
  import librosa
7
7
  import torch
8
- import perth
9
8
  import pyloudnorm as ln
10
9
 
11
10
  from safetensors.torch import load_file
@@ -127,7 +126,6 @@ class ChatterboxTurboTTS:
127
126
  self.tokenizer = tokenizer
128
127
  self.device = device
129
128
  self.conds = conds
130
- self.watermarker = perth.PerthImplicitWatermarker()
131
129
 
132
130
  @classmethod
133
131
  def from_local(cls, ckpt_dir, device) -> 'ChatterboxTurboTTS':
@@ -291,6 +289,4 @@ class ChatterboxTurboTTS:
291
289
  ref_dict=self.conds.gen,
292
290
  n_cfm_timesteps=2,
293
291
  )
294
- wav = wav.squeeze(0).detach().cpu().numpy()
295
- watermarked_wav = self.watermarker.apply_watermark(wav, sample_rate=self.sr)
296
- return torch.from_numpy(watermarked_wav).unsqueeze(0)
292
+ return wav.detach().to(device="cpu", dtype=torch.float32, copy=True)
@@ -2,7 +2,6 @@ from pathlib import Path
2
2
 
3
3
  import librosa
4
4
  import torch
5
- import perth
6
5
  from huggingface_hub import hf_hub_download
7
6
  from safetensors.torch import load_file
8
7
 
@@ -26,7 +25,6 @@ class ChatterboxVC:
26
25
  self.sr = S3GEN_SR
27
26
  self.s3gen = s3gen
28
27
  self.device = device
29
- self.watermarker = perth.PerthImplicitWatermarker()
30
28
  if ref_dict is None:
31
29
  self.ref_dict = None
32
30
  else:
@@ -99,6 +97,4 @@ class ChatterboxVC:
99
97
  speech_tokens=s3_tokens,
100
98
  ref_dict=self.ref_dict,
101
99
  )
102
- wav = wav.squeeze(0).detach().cpu().numpy()
103
- watermarked_wav = self.watermarker.apply_watermark(wav, sample_rate=self.sr)
104
- return torch.from_numpy(watermarked_wav).unsqueeze(0)
100
+ return wav.detach().to(device="cpu", dtype=torch.float32, copy=True)