sinapsis-speech 0.1.0__tar.gz → 0.2.2__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 (32) hide show
  1. sinapsis_speech-0.2.2/PKG-INFO +266 -0
  2. sinapsis_speech-0.2.2/README.md +243 -0
  3. {sinapsis_speech-0.1.0 → sinapsis_speech-0.2.2}/packages/sinapsis_elevenlabs/src/sinapsis_elevenlabs/helpers/env_var_keys.py +1 -1
  4. {sinapsis_speech-0.1.0 → sinapsis_speech-0.2.2}/packages/sinapsis_elevenlabs/src/sinapsis_elevenlabs/helpers/voice_utils.py +7 -23
  5. {sinapsis_speech-0.1.0 → sinapsis_speech-0.2.2}/packages/sinapsis_elevenlabs/src/sinapsis_elevenlabs/templates/elevenlabs_base.py +13 -23
  6. {sinapsis_speech-0.1.0 → sinapsis_speech-0.2.2}/packages/sinapsis_elevenlabs/src/sinapsis_elevenlabs/templates/elevenlabs_voice_generation.py +4 -1
  7. sinapsis_speech-0.2.2/packages/sinapsis_f5_tts/src/sinapsis_f5_tts/__init__.py +0 -0
  8. sinapsis_speech-0.2.2/packages/sinapsis_f5_tts/src/sinapsis_f5_tts/templates/__init__.py +20 -0
  9. sinapsis_speech-0.2.2/packages/sinapsis_f5_tts/src/sinapsis_f5_tts/templates/f5_tts_inference.py +357 -0
  10. sinapsis_speech-0.2.2/packages/sinapsis_speech.egg-info/PKG-INFO +266 -0
  11. {sinapsis_speech-0.1.0 → sinapsis_speech-0.2.2}/packages/sinapsis_speech.egg-info/SOURCES.txt +10 -1
  12. sinapsis_speech-0.2.2/packages/sinapsis_speech.egg-info/requires.txt +11 -0
  13. sinapsis_speech-0.2.2/packages/sinapsis_speech.egg-info/top_level.txt +3 -0
  14. sinapsis_speech-0.2.2/packages/sinapsis_zonos/src/sinapsis_zonos/__init__.py +0 -0
  15. sinapsis_speech-0.2.2/packages/sinapsis_zonos/src/sinapsis_zonos/helpers/__init__.py +0 -0
  16. sinapsis_speech-0.2.2/packages/sinapsis_zonos/src/sinapsis_zonos/helpers/zonos_keys.py +67 -0
  17. sinapsis_speech-0.2.2/packages/sinapsis_zonos/src/sinapsis_zonos/helpers/zonos_tts_utils.py +153 -0
  18. sinapsis_speech-0.2.2/packages/sinapsis_zonos/src/sinapsis_zonos/templates/__init__.py +20 -0
  19. sinapsis_speech-0.2.2/packages/sinapsis_zonos/src/sinapsis_zonos/templates/zonos_tts.py +172 -0
  20. {sinapsis_speech-0.1.0 → sinapsis_speech-0.2.2}/pyproject.toml +31 -28
  21. sinapsis_speech-0.1.0/PKG-INFO +0 -872
  22. sinapsis_speech-0.1.0/README.md +0 -184
  23. sinapsis_speech-0.1.0/packages/sinapsis_speech.egg-info/PKG-INFO +0 -872
  24. sinapsis_speech-0.1.0/packages/sinapsis_speech.egg-info/requires.txt +0 -15
  25. sinapsis_speech-0.1.0/packages/sinapsis_speech.egg-info/top_level.txt +0 -1
  26. {sinapsis_speech-0.1.0 → sinapsis_speech-0.2.2}/LICENSE +0 -0
  27. {sinapsis_speech-0.1.0 → sinapsis_speech-0.2.2}/packages/sinapsis_elevenlabs/src/sinapsis_elevenlabs/__init__.py +0 -0
  28. {sinapsis_speech-0.1.0 → sinapsis_speech-0.2.2}/packages/sinapsis_elevenlabs/src/sinapsis_elevenlabs/helpers/__init__.py +0 -0
  29. {sinapsis_speech-0.1.0 → sinapsis_speech-0.2.2}/packages/sinapsis_elevenlabs/src/sinapsis_elevenlabs/templates/__init__.py +0 -0
  30. {sinapsis_speech-0.1.0 → sinapsis_speech-0.2.2}/packages/sinapsis_elevenlabs/src/sinapsis_elevenlabs/templates/elevenlabs_tts.py +0 -0
  31. {sinapsis_speech-0.1.0 → sinapsis_speech-0.2.2}/packages/sinapsis_speech.egg-info/dependency_links.txt +0 -0
  32. {sinapsis_speech-0.1.0 → sinapsis_speech-0.2.2}/setup.cfg +0 -0
@@ -0,0 +1,266 @@
1
+ Metadata-Version: 2.4
2
+ Name: sinapsis-speech
3
+ Version: 0.2.2
4
+ Summary: Generate speech using various libraries.
5
+ Author-email: SinapsisAI <dev@sinapsis-ai.com>
6
+ Project-URL: Homepage, https://sinapsis.tech
7
+ Project-URL: Documentation, https://docs.sinapsis.tech/docs/sinapsis-speech
8
+ Project-URL: Tutorials, https://docs.sinapsis.tech/tutorials
9
+ Project-URL: Repository, https://github.com/Sinapsis-AI/sinapsis-speech.git
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: pip>=24.3.1
14
+ Requires-Dist: sinapsis>=0.2.2
15
+ Provides-Extra: all
16
+ Requires-Dist: sinapsis-elevenlabs[all]; extra == "all"
17
+ Requires-Dist: sinapsis-f5-tts[all]; extra == "all"
18
+ Requires-Dist: sinapsis-speech[gradio-app]; extra == "all"
19
+ Requires-Dist: sinapsis-zonos[all]; extra == "all"
20
+ Provides-Extra: gradio-app
21
+ Requires-Dist: sinapsis[webapp]>=0.2.3; extra == "gradio-app"
22
+ Dynamic: license-file
23
+
24
+ <h1 align="center">
25
+ <br>
26
+ <a href="https://sinapsis.tech/">
27
+ <img
28
+ src="https://github.com/Sinapsis-AI/brand-resources/blob/main/sinapsis_logo/4x/logo.png?raw=true"
29
+ alt="" width="300">
30
+ </a><br>
31
+ Sinapsis Speech
32
+ <br>
33
+ </h1>
34
+
35
+ <h4 align="center"> Templates for a wide range of voice generation tasks.</h4>
36
+
37
+ <p align="center">
38
+ <a href="#installation">🐍 Installation</a> •
39
+ <a href="#packages">📦 Packages</a> •
40
+ <a href="#webapp">🌐 Webapps</a> •
41
+ <a href="#documentation">📙 Documentation</a> •
42
+ <a href="#packages">🔍 License</a>
43
+ </p>
44
+
45
+
46
+ <h2 id="installation">🐍 Installation</h2>
47
+
48
+
49
+ > [!IMPORTANT]
50
+ > Sinapsis projects requires Python 3.10 or higher.
51
+ >
52
+
53
+ This repo includes packages for performing speech synthesis using different tools:
54
+
55
+ * <code>sinapsis-elevenlabs</code>
56
+ * <code>sinapsis-f5-tts</code>
57
+ * <code>sinapsis-zonos</code>
58
+
59
+ Install using your preferred package manager. We strongly recommend using <code>uv</code>. To install <code>uv</code>, refer to the [official documentation](https://docs.astral.sh/uv/getting-started/installation/#installation-methods).
60
+
61
+
62
+ Install with <code>uv</code>:
63
+ ```bash
64
+ uv pip install sinapsis-elevenlabs --extra-index-url https://pypi.sinapsis.tech
65
+ ```
66
+ Or with raw <code>pip</code>:
67
+ ```bash
68
+ pip install sinapsis-elevenlabs --extra-index-url https://pypi.sinapsis.tech
69
+ ```
70
+
71
+ **Replace `sinapsis-elevenlabs` with the name of the package you intend to install**.
72
+
73
+ > [!IMPORTANT]
74
+ > Templates in each package may require additional dependencies. For development, we recommend installing the package all optional dependencies:
75
+ >
76
+ With <code>uv</code>:
77
+
78
+ ```bash
79
+ uv pip install sinapsis-elevenlabs[all] --extra-index-url https://pypi.sinapsis.tech
80
+ ```
81
+ Or with raw <code>pip</code>:
82
+ ```bash
83
+ pip install sinapsis-elevenlabs[all] --extra-index-url https://pypi.sinapsis.tech
84
+ ```
85
+
86
+ **Be sure to substitute `sinapsis-elevenlabs` with the appropriate package name**.
87
+
88
+
89
+
90
+ > [!TIP]
91
+ > You can also install all the packages within this project:
92
+ >
93
+ ```bash
94
+ uv pip install sinapsis-speech[all] --extra-index-url https://pypi.sinapsis.tech
95
+ ```
96
+
97
+
98
+ <h2 id="packages">📦 Packages</h2>
99
+
100
+ This repository is organized into modular packages, each designed for integration with different text-to-speech tools. These packages provide ready-to-use templates for speech synthesis. Below is an overview of the available packages:
101
+
102
+ <details>
103
+ <summary id="elevenlabs"><strong><span style="font-size: 1.4em;"> Sinapsis ElevenLabs </span></strong></summary>
104
+
105
+ This package offers a suite of templates and utilities designed for effortless integrating, configuration, and execution of **text-to-speech (TTS)** and **voice generation** functionalities powered by [ElevenLabs](https://elevenlabs.io/).
106
+
107
+ - **ElevenLabsTTS**: Template for converting text into speech using ElevenLabs' voice models.
108
+
109
+ - **ElevenLabsVoiceGeneration**: Template for generating custom synthetic voices based on user-provided descriptions.
110
+
111
+ For specific instructions and further details, see the [README.md](https://github.com/Sinapsis-AI/sinapsis-speech/blob/main/packages/sinapsis_elevenlabs/README.md).
112
+
113
+ </details>
114
+
115
+
116
+ <details>
117
+ <summary id="f5tts"><strong><span style="font-size: 1.4em;"> Sinapsis F5-TTS</span></strong></summary>
118
+
119
+ This package provides a template for seamlessly integrating, configuring, and running **text-to-speech (TTS)** functionalities powered by [F5TTS](https://github.com/SWivid/F5-TTS).
120
+
121
+ - **F5TTSInference**: Converts text to speech using the F5TTS model with voice cloning capabilities.
122
+
123
+ For specific instructions and further details, see the [README.md](https://github.com/Sinapsis-AI/sinapsis-speech/blob/main/packages/sinapsis_f5_tts/README.md).
124
+
125
+ </details>
126
+
127
+ <details>
128
+ <summary id="zonos"><strong><span style="font-size: 1.4em;"> Sinapsis Zonos</span></strong></summary>
129
+
130
+ This package provides a single template for integrating, configuring, and running **text-to-speech (TTS)** and **voice cloning** functionalities powered by [Zonos](https://github.com/Zyphra/Zonos/tree/main).
131
+
132
+ - **ZonosTTS**: Template for converting text to speech or performing voice cloning based on the presence of an audio sample.​
133
+
134
+ For specific instructions and further details, see the [README.md](https://github.com/Sinapsis-AI/sinapsis-speech/blob/main/packages/sinapsis_zonos/README.md).
135
+
136
+ </details>
137
+
138
+ <h2 id="webapp">🌐 Webapps</h2>
139
+ The webapps included in this project showcase the modularity of the templates, in this case for speech generation tasks.
140
+
141
+ > [!IMPORTANT]
142
+ > To run the app you first need to clone this repository:
143
+
144
+ ```bash
145
+ git clone git@github.com:Sinapsis-ai/sinapsis-speech.git
146
+ cd sinapsis-speech
147
+ ```
148
+
149
+ > [!NOTE]
150
+ > If you'd like to enable external app sharing in Gradio, `export GRADIO_SHARE_APP=True`
151
+
152
+
153
+ > [!IMPORTANT]
154
+ > Elevenlabs requires an API key to run any inference. To get started, visit the [official website](https://elevenlabs.io) and create an account. If you already have an account, go to the [API keys page](https://elevenlabs.io/app/settings/api-keys) to generate a token.
155
+
156
+ > [!IMPORTANT]
157
+ > Set your env var using <code> export ELEVENLABS_API_KEY='your-api-key'</code>
158
+
159
+ > [!IMPORTANT]
160
+ > F5-TTS requires a reference audio file for voice cloning. Make sure you have a reference audio file in the artifacts directory.
161
+
162
+ > [!NOTE]
163
+ > Agent configuration can be changed through the `AGENT_CONFIG_PATH` env var. You can check the available configurations in each package configs folder.
164
+
165
+
166
+ <details>
167
+ <summary id="docker"><strong><span style="font-size: 1.4em;">🐳 Docker</span></strong></summary>
168
+
169
+ **IMPORTANT**: This Docker image depends on the `sinapsis-nvidia:base` image. For detailed instructions, please refer to the [Sinapsis README](https://github.com/Sinapsis-ai/sinapsis?tab=readme-ov-file#docker).
170
+
171
+ 1. **Build the sinapsis-speech image**:
172
+ ```bash
173
+ docker compose -f docker/compose.yaml build
174
+ ```
175
+
176
+ 2. **Start the app container**:
177
+ For ElevenLabs:
178
+ ```bash
179
+ docker compose -f docker/compose_apps.yaml up -d sinapsis-elevenlabs
180
+ ```
181
+ For F5-TTS:
182
+ ```bash
183
+ docker compose -f docker/compose_apps.yaml up -d sinapsis-f5_tts
184
+ ```
185
+ For Zonos:
186
+ ```bash
187
+ docker compose -f docker/compose_apps.yaml up -d sinapsis-zonos
188
+ ```
189
+
190
+ 3. **Check the logs**
191
+ For ElevenLabs:
192
+ ```bash
193
+ docker logs -f sinapsis-elevenlabs
194
+ ```
195
+ For F5-TTS:
196
+ ```bash
197
+ docker logs -f sinapsis-f5tts
198
+ ```
199
+ For Zonos:
200
+ ```bash
201
+ docker logs -f sinapsis-zonos
202
+ ```
203
+ 4. **The logs will display the URL to access the webapp, e.g.,:**:
204
+ ```bash
205
+ Running on local URL: http://127.0.0.1:7860
206
+ ```
207
+ **NOTE**: The url may be different, check the output of logs.
208
+ 5. **To stop the app**:
209
+ ```bash
210
+ docker compose -f docker/compose_apps.yaml down
211
+ ```
212
+ </details>
213
+
214
+ <details>
215
+ <summary id="virtual-environment"><strong><span style="font-size: 1.4em;">💻 UV</span></strong></summary>
216
+
217
+ To run the webapp using the <code>uv</code> package manager, follow these steps:
218
+
219
+ 1. **Sync the virtual environment**:
220
+
221
+ ```bash
222
+ uv sync --frozen
223
+ ```
224
+ 2. **Install the wheel**:
225
+
226
+ ```bash
227
+ uv pip install sinapsis-speech[all] --extra-index-url https://pypi.sinapsis.tech
228
+ ```
229
+
230
+ 3. **Run the webapp**:
231
+ For ElevenLabs:
232
+ ```bash
233
+ uv run webapps/elevenlabs/elevenlabs_tts_app.py
234
+ ```
235
+ For F5-TTS:
236
+ ```bash
237
+ uv run webapps/f5-tts/f5_tts_app.py
238
+ ```
239
+ For Zonos:
240
+ ```bash
241
+ uv run webapps/zonos/zonos_tts_app.py
242
+ ```
243
+ 4. **The terminal will display the URL to access the webapp (e.g.)**:
244
+ ```bash
245
+ Running on local URL: http://127.0.0.1:7860
246
+ ```
247
+ **NOTE**: The URL may vary; check the terminal output for the correct address.
248
+
249
+ </details>
250
+
251
+
252
+
253
+ <h2 id="documentation">📙 Documentation</h2>
254
+
255
+ Documentation is available on the [sinapsis website](https://docs.sinapsis.tech/docs)
256
+
257
+ Tutorials for different projects within sinapsis are available at [sinapsis tutorials page](https://docs.sinapsis.tech/tutorials)
258
+
259
+ <h2 id="license">🔍 License</h2>
260
+
261
+ This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the [LICENSE](LICENSE) file.
262
+
263
+ For commercial use, please refer to our [official Sinapsis website](https://sinapsis.tech) for information on obtaining a commercial license.
264
+
265
+
266
+
@@ -0,0 +1,243 @@
1
+ <h1 align="center">
2
+ <br>
3
+ <a href="https://sinapsis.tech/">
4
+ <img
5
+ src="https://github.com/Sinapsis-AI/brand-resources/blob/main/sinapsis_logo/4x/logo.png?raw=true"
6
+ alt="" width="300">
7
+ </a><br>
8
+ Sinapsis Speech
9
+ <br>
10
+ </h1>
11
+
12
+ <h4 align="center"> Templates for a wide range of voice generation tasks.</h4>
13
+
14
+ <p align="center">
15
+ <a href="#installation">🐍 Installation</a> •
16
+ <a href="#packages">📦 Packages</a> •
17
+ <a href="#webapp">🌐 Webapps</a> •
18
+ <a href="#documentation">📙 Documentation</a> •
19
+ <a href="#packages">🔍 License</a>
20
+ </p>
21
+
22
+
23
+ <h2 id="installation">🐍 Installation</h2>
24
+
25
+
26
+ > [!IMPORTANT]
27
+ > Sinapsis projects requires Python 3.10 or higher.
28
+ >
29
+
30
+ This repo includes packages for performing speech synthesis using different tools:
31
+
32
+ * <code>sinapsis-elevenlabs</code>
33
+ * <code>sinapsis-f5-tts</code>
34
+ * <code>sinapsis-zonos</code>
35
+
36
+ Install using your preferred package manager. We strongly recommend using <code>uv</code>. To install <code>uv</code>, refer to the [official documentation](https://docs.astral.sh/uv/getting-started/installation/#installation-methods).
37
+
38
+
39
+ Install with <code>uv</code>:
40
+ ```bash
41
+ uv pip install sinapsis-elevenlabs --extra-index-url https://pypi.sinapsis.tech
42
+ ```
43
+ Or with raw <code>pip</code>:
44
+ ```bash
45
+ pip install sinapsis-elevenlabs --extra-index-url https://pypi.sinapsis.tech
46
+ ```
47
+
48
+ **Replace `sinapsis-elevenlabs` with the name of the package you intend to install**.
49
+
50
+ > [!IMPORTANT]
51
+ > Templates in each package may require additional dependencies. For development, we recommend installing the package all optional dependencies:
52
+ >
53
+ With <code>uv</code>:
54
+
55
+ ```bash
56
+ uv pip install sinapsis-elevenlabs[all] --extra-index-url https://pypi.sinapsis.tech
57
+ ```
58
+ Or with raw <code>pip</code>:
59
+ ```bash
60
+ pip install sinapsis-elevenlabs[all] --extra-index-url https://pypi.sinapsis.tech
61
+ ```
62
+
63
+ **Be sure to substitute `sinapsis-elevenlabs` with the appropriate package name**.
64
+
65
+
66
+
67
+ > [!TIP]
68
+ > You can also install all the packages within this project:
69
+ >
70
+ ```bash
71
+ uv pip install sinapsis-speech[all] --extra-index-url https://pypi.sinapsis.tech
72
+ ```
73
+
74
+
75
+ <h2 id="packages">📦 Packages</h2>
76
+
77
+ This repository is organized into modular packages, each designed for integration with different text-to-speech tools. These packages provide ready-to-use templates for speech synthesis. Below is an overview of the available packages:
78
+
79
+ <details>
80
+ <summary id="elevenlabs"><strong><span style="font-size: 1.4em;"> Sinapsis ElevenLabs </span></strong></summary>
81
+
82
+ This package offers a suite of templates and utilities designed for effortless integrating, configuration, and execution of **text-to-speech (TTS)** and **voice generation** functionalities powered by [ElevenLabs](https://elevenlabs.io/).
83
+
84
+ - **ElevenLabsTTS**: Template for converting text into speech using ElevenLabs' voice models.
85
+
86
+ - **ElevenLabsVoiceGeneration**: Template for generating custom synthetic voices based on user-provided descriptions.
87
+
88
+ For specific instructions and further details, see the [README.md](https://github.com/Sinapsis-AI/sinapsis-speech/blob/main/packages/sinapsis_elevenlabs/README.md).
89
+
90
+ </details>
91
+
92
+
93
+ <details>
94
+ <summary id="f5tts"><strong><span style="font-size: 1.4em;"> Sinapsis F5-TTS</span></strong></summary>
95
+
96
+ This package provides a template for seamlessly integrating, configuring, and running **text-to-speech (TTS)** functionalities powered by [F5TTS](https://github.com/SWivid/F5-TTS).
97
+
98
+ - **F5TTSInference**: Converts text to speech using the F5TTS model with voice cloning capabilities.
99
+
100
+ For specific instructions and further details, see the [README.md](https://github.com/Sinapsis-AI/sinapsis-speech/blob/main/packages/sinapsis_f5_tts/README.md).
101
+
102
+ </details>
103
+
104
+ <details>
105
+ <summary id="zonos"><strong><span style="font-size: 1.4em;"> Sinapsis Zonos</span></strong></summary>
106
+
107
+ This package provides a single template for integrating, configuring, and running **text-to-speech (TTS)** and **voice cloning** functionalities powered by [Zonos](https://github.com/Zyphra/Zonos/tree/main).
108
+
109
+ - **ZonosTTS**: Template for converting text to speech or performing voice cloning based on the presence of an audio sample.​
110
+
111
+ For specific instructions and further details, see the [README.md](https://github.com/Sinapsis-AI/sinapsis-speech/blob/main/packages/sinapsis_zonos/README.md).
112
+
113
+ </details>
114
+
115
+ <h2 id="webapp">🌐 Webapps</h2>
116
+ The webapps included in this project showcase the modularity of the templates, in this case for speech generation tasks.
117
+
118
+ > [!IMPORTANT]
119
+ > To run the app you first need to clone this repository:
120
+
121
+ ```bash
122
+ git clone git@github.com:Sinapsis-ai/sinapsis-speech.git
123
+ cd sinapsis-speech
124
+ ```
125
+
126
+ > [!NOTE]
127
+ > If you'd like to enable external app sharing in Gradio, `export GRADIO_SHARE_APP=True`
128
+
129
+
130
+ > [!IMPORTANT]
131
+ > Elevenlabs requires an API key to run any inference. To get started, visit the [official website](https://elevenlabs.io) and create an account. If you already have an account, go to the [API keys page](https://elevenlabs.io/app/settings/api-keys) to generate a token.
132
+
133
+ > [!IMPORTANT]
134
+ > Set your env var using <code> export ELEVENLABS_API_KEY='your-api-key'</code>
135
+
136
+ > [!IMPORTANT]
137
+ > F5-TTS requires a reference audio file for voice cloning. Make sure you have a reference audio file in the artifacts directory.
138
+
139
+ > [!NOTE]
140
+ > Agent configuration can be changed through the `AGENT_CONFIG_PATH` env var. You can check the available configurations in each package configs folder.
141
+
142
+
143
+ <details>
144
+ <summary id="docker"><strong><span style="font-size: 1.4em;">🐳 Docker</span></strong></summary>
145
+
146
+ **IMPORTANT**: This Docker image depends on the `sinapsis-nvidia:base` image. For detailed instructions, please refer to the [Sinapsis README](https://github.com/Sinapsis-ai/sinapsis?tab=readme-ov-file#docker).
147
+
148
+ 1. **Build the sinapsis-speech image**:
149
+ ```bash
150
+ docker compose -f docker/compose.yaml build
151
+ ```
152
+
153
+ 2. **Start the app container**:
154
+ For ElevenLabs:
155
+ ```bash
156
+ docker compose -f docker/compose_apps.yaml up -d sinapsis-elevenlabs
157
+ ```
158
+ For F5-TTS:
159
+ ```bash
160
+ docker compose -f docker/compose_apps.yaml up -d sinapsis-f5_tts
161
+ ```
162
+ For Zonos:
163
+ ```bash
164
+ docker compose -f docker/compose_apps.yaml up -d sinapsis-zonos
165
+ ```
166
+
167
+ 3. **Check the logs**
168
+ For ElevenLabs:
169
+ ```bash
170
+ docker logs -f sinapsis-elevenlabs
171
+ ```
172
+ For F5-TTS:
173
+ ```bash
174
+ docker logs -f sinapsis-f5tts
175
+ ```
176
+ For Zonos:
177
+ ```bash
178
+ docker logs -f sinapsis-zonos
179
+ ```
180
+ 4. **The logs will display the URL to access the webapp, e.g.,:**:
181
+ ```bash
182
+ Running on local URL: http://127.0.0.1:7860
183
+ ```
184
+ **NOTE**: The url may be different, check the output of logs.
185
+ 5. **To stop the app**:
186
+ ```bash
187
+ docker compose -f docker/compose_apps.yaml down
188
+ ```
189
+ </details>
190
+
191
+ <details>
192
+ <summary id="virtual-environment"><strong><span style="font-size: 1.4em;">💻 UV</span></strong></summary>
193
+
194
+ To run the webapp using the <code>uv</code> package manager, follow these steps:
195
+
196
+ 1. **Sync the virtual environment**:
197
+
198
+ ```bash
199
+ uv sync --frozen
200
+ ```
201
+ 2. **Install the wheel**:
202
+
203
+ ```bash
204
+ uv pip install sinapsis-speech[all] --extra-index-url https://pypi.sinapsis.tech
205
+ ```
206
+
207
+ 3. **Run the webapp**:
208
+ For ElevenLabs:
209
+ ```bash
210
+ uv run webapps/elevenlabs/elevenlabs_tts_app.py
211
+ ```
212
+ For F5-TTS:
213
+ ```bash
214
+ uv run webapps/f5-tts/f5_tts_app.py
215
+ ```
216
+ For Zonos:
217
+ ```bash
218
+ uv run webapps/zonos/zonos_tts_app.py
219
+ ```
220
+ 4. **The terminal will display the URL to access the webapp (e.g.)**:
221
+ ```bash
222
+ Running on local URL: http://127.0.0.1:7860
223
+ ```
224
+ **NOTE**: The URL may vary; check the terminal output for the correct address.
225
+
226
+ </details>
227
+
228
+
229
+
230
+ <h2 id="documentation">📙 Documentation</h2>
231
+
232
+ Documentation is available on the [sinapsis website](https://docs.sinapsis.tech/docs)
233
+
234
+ Tutorials for different projects within sinapsis are available at [sinapsis tutorials page](https://docs.sinapsis.tech/tutorials)
235
+
236
+ <h2 id="license">🔍 License</h2>
237
+
238
+ This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the [LICENSE](LICENSE) file.
239
+
240
+ For commercial use, please refer to our [official Sinapsis website](https://sinapsis.tech) for information on obtaining a commercial license.
241
+
242
+
243
+
@@ -12,7 +12,7 @@ class _ElevenlabsKeys(BaseModel):
12
12
 
13
13
  ELEVENLABS_API_KEY: EnvVarEntry = EnvVarEntry(
14
14
  var_name="ELEVENLABS_API_KEY",
15
- default_value=" ",
15
+ default_value=None,
16
16
  allowed_values=None,
17
17
  description="set api key for Elevenlabs",
18
18
  )
@@ -9,34 +9,18 @@ def create_voice_settings(settings: VoiceSettings) -> VoiceSettings | None:
9
9
  """
10
10
  Creates or updates a `VoiceSettings` object based on the provided settings.
11
11
 
12
- This function attempts to create or update a `VoiceSettings` object using the provided
13
- `VoiceSettings` instance. If any of the fields in the settings contain `None`,
14
- the corresponding field is populated with a default value from `DEFAULT_VOICE.settings`.
15
- If all fields are valid (i.e., none are `None`), the provided `settings` object is returned unchanged.
16
-
17
- If the settings argument is `None` or if no valid settings are provided, the function
18
- returns `None`.
19
-
20
12
  Args:
21
- settings (VoiceSettings): An instance of `VoiceSettings` containing the settings to be applied.
22
- This object may have fields with `None` values that should be replaced with default values.
13
+ settings (VoiceSettings | None): An instance of `VoiceSettings` containing the settings to be applied.
14
+ If `None`, the function returns the default settings.
23
15
 
24
16
  Returns:
25
- VoiceSettings: A `VoiceSettings` object created or updated with the provided settings. If any field
26
- was `None`, it is updated with default values. If the settings are invalid or empty,
27
- `None` is returned.
17
+ VoiceSettings: The provided `VoiceSettings` object if `settings` is not `None`. Otherwise,
18
+ `DEFAULT_VOICE.settings` is returned.
28
19
  """
29
- if settings:
30
- settings_dict = settings.model_dump()
31
- if any(value is None for value in settings_dict.values()):
32
- for field, value in settings_dict.items():
33
- if value is None:
34
- settings_dict[field] = getattr(DEFAULT_VOICE.settings, field)
20
+ if not settings:
21
+ return DEFAULT_VOICE.settings
35
22
 
36
- return VoiceSettings(**settings_dict)
37
- else:
38
- return settings
39
- return None
23
+ return settings
40
24
 
41
25
 
42
26
  def get_voice_id(client: ElevenLabs, voice: VoiceId | VoiceName) -> VoiceId:
@@ -9,6 +9,8 @@ from typing import IO, Iterator, Literal
9
9
 
10
10
  from elevenlabs import Voice, VoiceSettings, save
11
11
  from elevenlabs.client import ElevenLabs, VoiceId, VoiceName
12
+ from elevenlabs.types import OutputFormat
13
+ from pydantic import Field
12
14
  from sinapsis_core.data_containers.data_packet import AudioPacket, DataContainer, Packet
13
15
  from sinapsis_core.template_base.template import (
14
16
  Template,
@@ -40,25 +42,23 @@ class ElevenLabsBase(Template, abc.ABC):
40
42
  """
41
43
  Attributes for ElevenLabs Base Class.
42
44
  Args:
43
- api_key (str): The API key to authenticate with ElevenLabs' API.
44
- voice (str|elevenlabs.Voice): The voice to use for speech synthesis. This can be a voice ID (str),
45
+ api_key (str): The API used key to authenticate with ElevenLabs' API.
46
+ model (Literal): The model identifier to use for speech synthesis.
47
+ output_format (OutputFormat): The output audio format and quality. Options include:
48
+ ["mp3_22050_32", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "mp3_44100_128",
49
+ "mp3_44100_192", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_44100", "ulaw_8000"]
50
+ output_folder (str): The folder where generated audio files will be saved.
51
+ stream (bool): If True, the audio is returned as a stream; otherwise, saved to a file.
52
+ voice (VoiceId | VoiceName | Voice): The voice to use for speech synthesis. This can be a voice ID (str),
45
53
  a voice name (str) or an elevenlabs voice object (Voice).
46
54
  voice_settings (VoiceSettings): A dictionary of settings that control the behavior of the voice.
47
55
  - stability (float)
48
56
  - similarity_boost (float)
49
57
  - style (float)
50
58
  - use_speaker_boost (bool)
51
- model (Literal): The model identifier to use for speech synthesis.
52
- output_format (Literal): The output audio format and quality. Options include:
53
- ["mp3_22050_32", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "mp3_44100_128",
54
- "mp3_44100_192", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_44100", "ulaw_8000"]
55
- output_folder (str): The folder where generated audio files will be saved.
56
- stream (bool): If True, the audio is returned as a stream; otherwise, saved to a file.
57
59
  """
58
60
 
59
61
  api_key: str | None = None
60
- voice: VoiceId | VoiceName | Voice = None
61
- voice_settings: VoiceSettings | None = None
62
62
  model: Literal[
63
63
  "eleven_turbo_v2_5",
64
64
  "eleven_multilingual_v2",
@@ -68,21 +68,11 @@ class ElevenLabsBase(Template, abc.ABC):
68
68
  "eleven_english_sts_v2",
69
69
  "eleven_multilingual_sts_v2",
70
70
  ] = "eleven_turbo_v2_5"
71
- output_format: Literal[
72
- "mp3_22050_32",
73
- "mp3_44100_32",
74
- "mp3_44100_64",
75
- "mp3_44100_96",
76
- "mp3_44100_128",
77
- "mp3_44100_192",
78
- "pcm_16000",
79
- "pcm_22050",
80
- "pcm_24000",
81
- "pcm_44100",
82
- "ulaw_8000",
83
- ] = "mp3_44100_128"
71
+ output_format: OutputFormat = "mp3_44100_128"
84
72
  output_folder: str = os.path.join(SINAPSIS_CACHE_DIR, "elevenlabs", "audios")
85
73
  stream: bool = False
74
+ voice: VoiceId | VoiceName | Voice = None
75
+ voice_settings: VoiceSettings = Field(default_factory=dict) # type: ignore[arg-type]
86
76
 
87
77
  def __init__(self, attributes: TemplateAttributeType) -> None:
88
78
  """Initializes the ElevenLabs API client with the given attributes."""
@@ -42,9 +42,12 @@ class ElevenLabsVoiceGeneration(ElevenLabsBase):
42
42
  class AttributesBaseModel(ElevenLabsBase.AttributesBaseModel):
43
43
  """
44
44
  Attributes for voice generation in ElevenLabs API.
45
+
46
+ Args:
47
+ voice_description (str): A description of the voice to be used for synthesis.
45
48
  """
46
49
 
47
- voice_description: str = "An old British male with a raspy, deep voice. Professional, relaxed and assertive"
50
+ voice_description: str
48
51
 
49
52
  def synthesize_speech(self, input_data: list[TextPacket]) -> list[bytes] | None:
50
53
  """
@@ -0,0 +1,20 @@
1
+ # -*- coding: utf-8 -*-
2
+ import importlib
3
+ from typing import Callable
4
+
5
+ _root_lib_path = "sinapsis_f5_tts.templates"
6
+
7
+ _template_lookup = {
8
+ "F5TTSInference": f"{_root_lib_path}.f5_tts_inference",
9
+ }
10
+
11
+
12
+ def __getattr__(name: str) -> Callable:
13
+ if name in _template_lookup:
14
+ module = importlib.import_module(_template_lookup[name])
15
+ return getattr(module, name)
16
+
17
+ raise AttributeError(f"template `{name}` not found in {_root_lib_path}")
18
+
19
+
20
+ __all__ = list(_template_lookup.keys())