Release self-contained experimental Persian TTS with verified offline CPU inference
Browse files- .gitattributes +2 -0
- LICENSE +201 -0
- NOTICE +6 -0
- README.md +111 -0
- SHA256SUMS.json +126 -0
- acoustic.safetensors +3 -0
- environment.json +13 -0
- examples/example.txt +2 -0
- examples/reference.wav +3 -0
- examples/standalone.json +56 -0
- examples/standalone.wav +3 -0
- frontend/added_tokens.json +127 -0
- frontend/config.json +32 -0
- frontend/generation_config.json +6 -0
- frontend/model.safetensors +3 -0
- frontend/overlay.json +1 -0
- frontend/special_tokens_map.json +23 -0
- frontend/tokenizer_config.json +1040 -0
- gooya_config.json +234 -0
- gooya_tts/__init__.py +2 -0
- gooya_tts/hifigan.py +292 -0
- gooya_tts/networks.py +469 -0
- gooya_tts/normalize.py +77 -0
- gooya_tts/runtime.py +89 -0
- gooya_tts/words.py +21 -0
- infer.py +13 -0
- licenses/HiFi-GAN-MIT.txt +21 -0
- licenses/Negara-Apache-2.0.txt +202 -0
- provenance.json +27 -0
- pyproject.toml +12 -0
- requirements.txt +7 -0
- verification.json +25 -0
- vocoder.safetensors +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
examples/reference.wav filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
examples/standalone.wav filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
| 177 |
+
|
| 178 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 179 |
+
|
| 180 |
+
To apply the Apache License to your work, attach the following
|
| 181 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 182 |
+
replaced with your own identifying information. (Don't include
|
| 183 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 184 |
+
comment syntax for the file format. We also recommend that a
|
| 185 |
+
file or class name and description of purpose be included on the
|
| 186 |
+
same "printed page" as the copyright notice for easier
|
| 187 |
+
identification within third-party archives.
|
| 188 |
+
|
| 189 |
+
Copyright [yyyy] [name of copyright owner]
|
| 190 |
+
|
| 191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 192 |
+
you may not use this file except in compliance with the License.
|
| 193 |
+
You may obtain a copy of the License at
|
| 194 |
+
|
| 195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 196 |
+
|
| 197 |
+
Unless required by applicable law or agreed to in writing, software
|
| 198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 200 |
+
See the License for the specific language governing permissions and
|
| 201 |
+
limitations under the License.
|
NOTICE
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Gooya experimental Persian TTS release.
|
| 2 |
+
GrainSpeech: Zitao Liang and Chang Gao, Apache-2.0; includes EfficientSpeech-derived code by Rowel Atienza (2023), Apache-2.0.
|
| 3 |
+
HiFi-GAN source and adapted generator: MIT, see licenses/HiFi-GAN-MIT.txt.
|
| 4 |
+
Negara v7.1 teacher/frontend: Apache-2.0, see licenses/Negara-Apache-2.0.txt.
|
| 5 |
+
Modifications: Persian vocabulary, 100-mel output, contextual encoder, duration supervision, speaker-adapted vocoder, frontend distillation, and standalone runtime.
|
| 6 |
+
Dataset attribution and limitations are in README.md; this package does not relicense source datasets.
|
README.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- fa
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
pipeline_tag: text-to-speech
|
| 6 |
+
tags:
|
| 7 |
+
- pytorch
|
| 8 |
+
- persian
|
| 9 |
+
- grainspeech
|
| 10 |
+
- hifi-gan
|
| 11 |
+
- experimental
|
| 12 |
+
- single-speaker
|
| 13 |
+
model_name: Gooya RizehPizeh v2 exp
|
| 14 |
+
base_model:
|
| 15 |
+
- Reza2kn/negara-g2p-clean-v7.1
|
| 16 |
+
datasets:
|
| 17 |
+
- Reza2kn/nasle-mana-clean-chunked-30s-avasanj
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# Gooya RizehPizeh v2 exp
|
| 21 |
+
|
| 22 |
+
Self-contained experimental Persian text-to-speech: **9,451,575 parameters**, including G2P, a contextual GrainSpeech acoustic model, and a tiny speaker-adapted HiFi-GAN vocoder. Produces 24 kHz mono WAV audio. The entire stack is included in this repository and runs offline after downloading and installing dependencies.
|
| 23 |
+
|
| 24 |
+
This is the stack used for the September 24 listening comparison. It includes the full 8.07M Negara v7.1 model and its overlay. No Vocos, AvaSanj, training corpus, external checkpoint, Lightning, or remote inference service is required.
|
| 25 |
+
|
| 26 |
+
## Quick start
|
| 27 |
+
|
| 28 |
+
Python 3.10+; CPU is the default. CUDA is optional. PyTorch is a separate runtime dependency: the model weight size is not the installation size or peak RAM requirement. Old-device speed, Windows, mobile and browser inference have not been benchmarked.
|
| 29 |
+
|
| 30 |
+
```bash
|
| 31 |
+
python -m pip install huggingface_hub
|
| 32 |
+
hf download Reza2kn/Gooya-RizehPizeh-v2-exp --local-dir Gooya-RizehPizeh-v2-exp
|
| 33 |
+
python -m pip install -r Gooya-RizehPizeh-v2-exp/requirements.txt
|
| 34 |
+
python Gooya-RizehPizeh-v2-exp/infer.py --text "سلام، امروز حال شما چطوره؟" --output speech.wav
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
For a smaller CPU-only installation on Linux, install CPU PyTorch before the requirements:
|
| 38 |
+
|
| 39 |
+
```bash
|
| 40 |
+
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
|
| 41 |
+
python -m pip install -r Gooya-RizehPizeh-v2-exp/requirements.txt
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
To reproduce the included longer sample:
|
| 45 |
+
|
| 46 |
+
```bash
|
| 47 |
+
python Gooya-RizehPizeh-v2-exp/infer.py --text-file Gooya-RizehPizeh-v2-exp/examples/example.txt --output sample.wav
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
Pass `--device cuda` for GPU inference or `--threads 2` to limit CPU threads. The CLI also writes a JSON trace containing normalized text, generated phonemes, and segment durations. Model inference uses local files only. For fully offline use after setup, set `HF_HUB_OFFLINE=1` and `TRANSFORMERS_OFFLINE=1`.
|
| 51 |
+
|
| 52 |
+
## Python API
|
| 53 |
+
|
| 54 |
+
Install the included Python package once:
|
| 55 |
+
|
| 56 |
+
```bash
|
| 57 |
+
python -m pip install ./Gooya-RizehPizeh-v2-exp
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
```python
|
| 61 |
+
import soundfile as sf
|
| 62 |
+
from gooya_tts import GooyaTTS
|
| 63 |
+
|
| 64 |
+
model = GooyaTTS("Gooya-RizehPizeh-v2-exp", device="cpu")
|
| 65 |
+
audio, trace = model.synthesize("سلام، امروز حال شما چطوره؟", return_details=True)
|
| 66 |
+
sf.write("speech.wav", audio, model.sample_rate, subtype="FLOAT")
|
| 67 |
+
|
| 68 |
+
# Alternatively download the complete model snapshot explicitly:
|
| 69 |
+
# model = GooyaTTS.from_pretrained("Reza2kn/Gooya-RizehPizeh-v2-exp", device="cpu")
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
## Components and size
|
| 73 |
+
|
| 74 |
+
| Component | Parameters |
|
| 75 |
+
|---|---:|
|
| 76 |
+
| Negara v7.1 | 8,067,456 |
|
| 77 |
+
| Contextual GrainSpeech acoustic model | 437,685 |
|
| 78 |
+
| Tiny HiFi-GAN | 946,434 |
|
| 79 |
+
| **Total** | **9,451,575** |
|
| 80 |
+
|
| 81 |
+
Counts include fixed bins and weight-normalization parameters. Weights are FP32 safetensors; nominal parameter storage is about 37.81 MB, plus configs, tokenizer, code and examples. Training-only discriminators and optimizers are omitted. Exact file sizes and SHA-256 checksums are in `SHA256SUMS.json`.
|
| 82 |
+
|
| 83 |
+
## Inference behavior
|
| 84 |
+
|
| 85 |
+
The frontend deterministically expands supported number forms, then predicts case-sensitive Negara phonemes. Input is divided at commas, sentence punctuation and newlines. It adds 150 ms comma gaps and 300 ms sentence gaps, matching the listening comparison; these gaps are fixed rather than learned prosody. Acoustic durations, pitch and energy are predicted from phones. Tiny HiFi-GAN receives 100-bin mel features with hop 256 at 24 kHz.
|
| 86 |
+
|
| 87 |
+
Negara uses beam width 5 and exact surface-word/raw-phone overlay matches. The overlay does not apply when word counts disagree. Inputs are not silently truncated. If G2P fails to emit EOS within 512 tokens or produces unsupported symbols, inference raises an error; use shorter phrases rather than accepting incomplete audio. Word-count disagreements produce a warning and remain visible in the trace. This is not a speech-completeness guarantee.
|
| 88 |
+
|
| 89 |
+
## Training and provenance
|
| 90 |
+
|
| 91 |
+
Acoustic/vocoder training uses the dataset's `label` field, not Koochik or Gemini ASR replacements. Source: [Nasle Mana](https://huggingface.co/datasets/Reza2kn/nasle-mana-clean-chunked-30s-avasanj), revision `606ecdc1d93a77c6f3a452ab5721774248cdf587`. After machine G2P/alignment filtering: 9,255 training excerpts / 19.10 hours and 2,337 development excerpts / 5.48 hours, with disjoint source recording groups. It did not consume every second of the source's approximately 41.4 labeled hours.
|
| 92 |
+
|
| 93 |
+
Architecture derives from [GrainSpeech](https://github.com/lab-emi/GrainSpeech), commit `8b38829809a6f86a9699371adc487c1efb875b05`, with a contextual bidirectional GRU, explicit boundary duration handling, and a 100-bin mel projection. The prosody variant trained for 50 epochs; the packaged best development checkpoint is step 10,413. The waveform generator derives from [HiFi-GAN V2](https://github.com/jik876/hifi-gan), with a new 100-mel input layer and 50,000 speaker-adaptation updates; selection used a fixed 96-excerpt development subset. See `provenance.json` for hashes and selected steps.
|
| 94 |
+
|
| 95 |
+
## Limitations
|
| 96 |
+
|
| 97 |
+
Uses full Negara v7.1 plus its exact-match correction overlay. This frontend is the stronger reference used in our comparisons, but this complete TTS stack has no comprehensive human intelligibility or naturalness benchmark.
|
| 98 |
+
|
| 99 |
+
User listening found the tiny vocoder acceptable for these samples, but speech can still be robotic. Proper names, colloquial spelling, ezafe, unfamiliar text, numbers, phrase boundaries and long inputs may fail. No MOS score, human pronunciation accuracy, real-time factor, memory ceiling, or device compatibility claim is made. A successful waveform or low training loss does not establish naturalness.
|
| 100 |
+
|
| 101 |
+
## Licensing and attribution
|
| 102 |
+
|
| 103 |
+
Release code and distributed modifications are Apache-2.0. Preserve the bundled Apache and MIT notices: GrainSpeech/EfficientSpeech and Negara use Apache-2.0; HiFi-GAN uses MIT. See `LICENSE`, `NOTICE`, and `licenses/`. Dataset copyrights and usage terms remain with their respective sources; this repository does not grant new rights to source recordings or imply speaker endorsement.
|
| 104 |
+
|
| 105 |
+
## Files
|
| 106 |
+
|
| 107 |
+
- `frontend/`: complete G2P model/tokenizer and overlay where applicable.
|
| 108 |
+
- `acoustic.safetensors`, `vocoder.safetensors`: inference-only weights.
|
| 109 |
+
- `gooya_config.json`, `gooya_tts/`, `infer.py`: standalone architecture, normalization, runtime and CLI.
|
| 110 |
+
- `examples/`: requested Persian sample and standalone output.
|
| 111 |
+
- `provenance.json`, `verification.json`, `SHA256SUMS.json`: provenance, verification receipt and integrity checks.
|
SHA256SUMS.json
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"LICENSE": {
|
| 3 |
+
"sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4",
|
| 4 |
+
"bytes": 11357
|
| 5 |
+
},
|
| 6 |
+
"NOTICE": {
|
| 7 |
+
"sha256": "094cc69de33f864e265f17eb8ecf33085ad2554554254b4b231d30d50bd81f65",
|
| 8 |
+
"bytes": 588
|
| 9 |
+
},
|
| 10 |
+
"README.md": {
|
| 11 |
+
"sha256": "b0ab50b1b0250b48a7bfcc494ac0c1cf5f7d70d63fc6180c472ca944e707ffc4",
|
| 12 |
+
"bytes": 6818
|
| 13 |
+
},
|
| 14 |
+
"acoustic.safetensors": {
|
| 15 |
+
"sha256": "91a1f668b7312058c9d8769caca158f254a5897bac1f61099222ef90a358f8b2",
|
| 16 |
+
"bytes": 1763212
|
| 17 |
+
},
|
| 18 |
+
"environment.json": {
|
| 19 |
+
"sha256": "e0f4cb8ae822fe87ffdd82e4deb8adcd9d8a462b3ebb845aa70c07105c9f65d7",
|
| 20 |
+
"bytes": 276
|
| 21 |
+
},
|
| 22 |
+
"examples/example.txt": {
|
| 23 |
+
"sha256": "c6b045cef670a8e4d774471f9d0bf475531e9fa79685641fb018bd97c1e492aa",
|
| 24 |
+
"bytes": 383
|
| 25 |
+
},
|
| 26 |
+
"examples/reference.wav": {
|
| 27 |
+
"sha256": "87b276e0963da49cf07de685f7ab1e4fcab256195b97ae92663b4ad2b3acf2b7",
|
| 28 |
+
"bytes": 1671696
|
| 29 |
+
},
|
| 30 |
+
"examples/standalone.json": {
|
| 31 |
+
"sha256": "90b57291a395de03b800bb27f7d5b2819e9da34d63d34a8ba2af9c2ce39a5f8e",
|
| 32 |
+
"bytes": 2530
|
| 33 |
+
},
|
| 34 |
+
"examples/standalone.wav": {
|
| 35 |
+
"sha256": "e999d1a8078150b5063e2884a1039b5a26f9778b718310be7658055c40304c8b",
|
| 36 |
+
"bytes": 1671696
|
| 37 |
+
},
|
| 38 |
+
"frontend/added_tokens.json": {
|
| 39 |
+
"sha256": "0004781309423057d33b9edf50d2669253d4347873ea33d4e7755cb866f23883",
|
| 40 |
+
"bytes": 3018
|
| 41 |
+
},
|
| 42 |
+
"frontend/config.json": {
|
| 43 |
+
"sha256": "a9ada2eff93810c2aa3bb251ba9c2edb7124f9ac4f947617aa9c18f45add2129",
|
| 44 |
+
"bytes": 791
|
| 45 |
+
},
|
| 46 |
+
"frontend/generation_config.json": {
|
| 47 |
+
"sha256": "e6bacb7faf7c3268de56b772c5b53f926545e0507686216bee531d2abc997fba",
|
| 48 |
+
"bytes": 112
|
| 49 |
+
},
|
| 50 |
+
"frontend/model.safetensors": {
|
| 51 |
+
"sha256": "2d89883abe07082cfb291203c1e5609f8974e71ca04d6c3e73bf2d32f8b715cf",
|
| 52 |
+
"bytes": 32275776
|
| 53 |
+
},
|
| 54 |
+
"frontend/overlay.json": {
|
| 55 |
+
"sha256": "9e063c2f26db4f56f6a93fef33f1f2a25423318ff7073b9954fddf4c4085412f",
|
| 56 |
+
"bytes": 7003
|
| 57 |
+
},
|
| 58 |
+
"frontend/special_tokens_map.json": {
|
| 59 |
+
"sha256": "7dc2ed3d3cc896f2e2e053dc1635d8b1d0e2b50094f0ae963a4d7fda6f4ced06",
|
| 60 |
+
"bytes": 413
|
| 61 |
+
},
|
| 62 |
+
"frontend/tokenizer_config.json": {
|
| 63 |
+
"sha256": "7f65014e433cc8c5c57951c1645eae6d3af3fb6fd8f5b7e56ec89f2ef228bb69",
|
| 64 |
+
"bytes": 23033
|
| 65 |
+
},
|
| 66 |
+
"gooya_config.json": {
|
| 67 |
+
"sha256": "9e2f6effb65c65efc1d030d81dca122c3024a17eb687386c2a8f4968ba15f796",
|
| 68 |
+
"bytes": 4832
|
| 69 |
+
},
|
| 70 |
+
"gooya_tts/__init__.py": {
|
| 71 |
+
"sha256": "b3bf2aa08a6e6d1a79f58ad742daeaf42844cf6c0a7888fcba6add3ef84cb2db",
|
| 72 |
+
"bytes": 53
|
| 73 |
+
},
|
| 74 |
+
"gooya_tts/hifigan.py": {
|
| 75 |
+
"sha256": "7b1518b88012a32b4339ea5b18603bf0728beb6eb5bf44d11dd3032bbb0017a4",
|
| 76 |
+
"bytes": 10455
|
| 77 |
+
},
|
| 78 |
+
"gooya_tts/networks.py": {
|
| 79 |
+
"sha256": "71cae5846af1369ca689e970a6fa191881137cc71f6daaa7dc554b52227f099a",
|
| 80 |
+
"bytes": 16856
|
| 81 |
+
},
|
| 82 |
+
"gooya_tts/normalize.py": {
|
| 83 |
+
"sha256": "12dc5440d0c74d6476d6260c0276594bed27c60b997c1034dc12b425e3201df9",
|
| 84 |
+
"bytes": 3150
|
| 85 |
+
},
|
| 86 |
+
"gooya_tts/runtime.py": {
|
| 87 |
+
"sha256": "e64d4a5c10f77ccd7af0129f21f2a889626e148ad2748b74b11cf44f2f05ab27",
|
| 88 |
+
"bytes": 6812
|
| 89 |
+
},
|
| 90 |
+
"gooya_tts/words.py": {
|
| 91 |
+
"sha256": "d764587724b171ae0d05d7f067fa950c8e02210150474979c4a55d8b35b4ee24",
|
| 92 |
+
"bytes": 715
|
| 93 |
+
},
|
| 94 |
+
"infer.py": {
|
| 95 |
+
"sha256": "b12929e3c01fc56efa0a8254f163aab37b01a8e0dd529ceb3a44590be90c54c8",
|
| 96 |
+
"bytes": 1238
|
| 97 |
+
},
|
| 98 |
+
"licenses/HiFi-GAN-MIT.txt": {
|
| 99 |
+
"sha256": "dc2e017a9a4430fbd21aa83345310fa34b7050d6c1d7a06d30436f7e5c4be2f4",
|
| 100 |
+
"bytes": 1087
|
| 101 |
+
},
|
| 102 |
+
"licenses/Negara-Apache-2.0.txt": {
|
| 103 |
+
"sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30",
|
| 104 |
+
"bytes": 11358
|
| 105 |
+
},
|
| 106 |
+
"provenance.json": {
|
| 107 |
+
"sha256": "5d6bbefcdc0e05294ebf121e7f71e78979fdfe6bc498debf95eaa4ec008b97e2",
|
| 108 |
+
"bytes": 1121
|
| 109 |
+
},
|
| 110 |
+
"pyproject.toml": {
|
| 111 |
+
"sha256": "d0a0e921f1a41abec9ffad5e909bdf46a4aa52f1d15a26a55aa993b698f85dc7",
|
| 112 |
+
"bytes": 327
|
| 113 |
+
},
|
| 114 |
+
"requirements.txt": {
|
| 115 |
+
"sha256": "9bb7a77f19f45c7839d92eb6e923df6f50739b01bd6793c5e5192257e20e5cbe",
|
| 116 |
+
"bytes": 115
|
| 117 |
+
},
|
| 118 |
+
"verification.json": {
|
| 119 |
+
"sha256": "7352ddcd2021a34962d8f40ee35203457b195cdac137ee9a5e95fc312b3d3700",
|
| 120 |
+
"bytes": 971
|
| 121 |
+
},
|
| 122 |
+
"vocoder.safetensors": {
|
| 123 |
+
"sha256": "081fb32646d70590e52926115b13481753c6d846647111a502cc93c3295a0a67",
|
| 124 |
+
"bytes": 3807768
|
| 125 |
+
}
|
| 126 |
+
}
|
acoustic.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:91a1f668b7312058c9d8769caca158f254a5897bac1f61099222ef90a358f8b2
|
| 3 |
+
size 1763212
|
environment.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"tested_platform": "Linux x86_64 CPU",
|
| 3 |
+
"python": "3.13.11",
|
| 4 |
+
"packages": {
|
| 5 |
+
"torch": "2.14.0+cpu",
|
| 6 |
+
"transformers": "5.17.0",
|
| 7 |
+
"safetensors": "0.8.0",
|
| 8 |
+
"numpy": "2.5.3",
|
| 9 |
+
"soundfile": "0.14.0",
|
| 10 |
+
"einops": "0.8.2",
|
| 11 |
+
"huggingface_hub": "1.33.0"
|
| 12 |
+
}
|
| 13 |
+
}
|
examples/example.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
به جای اینکه مدل رو مجبور کنن جواب رو توکن توکن بنویسه که طول میکشه، ازش فقط میپرسن فلان چیز چطوره؟ چندتا گزینه هم میدن.
|
| 2 |
+
بعد مدل همین که به گزینه ها نگاه کنه ، درصد احتمال هرگزینه رو میبینه، بدون هیچ محاسبه اضافی
|
examples/reference.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:87b276e0963da49cf07de685f7ab1e4fcab256195b97ae92663b4ad2b3acf2b7
|
| 3 |
+
size 1671696
|
examples/standalone.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"text": "به جای اینکه مدل رو مجبور کنن جواب رو توکن توکن بنویسه که طول میکشه، ازش فقط میپرسن فلان چیز چطوره؟ چندتا گزینه هم میدن.\nبعد مدل همین که به گزینه ها نگاه کنه ، درصد احتمال هرگزینه رو میبینه، بدون هیچ محاسبه اضافی",
|
| 3 |
+
"model": "Gooya-RizehPizeh-v2-exp",
|
| 4 |
+
"parameters": {
|
| 5 |
+
"total": 9451575,
|
| 6 |
+
"acoustic": 437685,
|
| 7 |
+
"vocoder": 946434,
|
| 8 |
+
"g2p": 8067456
|
| 9 |
+
},
|
| 10 |
+
"sample_rate": 24000,
|
| 11 |
+
"segments": [
|
| 12 |
+
{
|
| 13 |
+
"text": "به جای اینکه مدل رو مجبور کنن جواب رو توکن توکن بنویسه که طول میکشه،",
|
| 14 |
+
"normalized": "به جای اینکه مدل رو مجبور کنن جواب رو توکن توکن بنویسه که طول میکشه،",
|
| 15 |
+
"phonemes": "be jAye inke model ro majbur konan javAb ro tokon tokon benevise ke tul mikeshe",
|
| 16 |
+
"word_count_matches": true,
|
| 17 |
+
"duration_seconds": 5.088
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
"text": "ازش فقط میپرسن فلان چیز چطوره؟",
|
| 21 |
+
"normalized": "ازش فقط میپرسن فلان چیز چطوره؟",
|
| 22 |
+
"phonemes": "azaS faqat miporsen folAn Ciz Cetoreh",
|
| 23 |
+
"word_count_matches": true,
|
| 24 |
+
"duration_seconds": 2.72
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"text": "چندتا گزینه هم میدن.",
|
| 28 |
+
"normalized": "چندتا گزینه هم میدن.",
|
| 29 |
+
"phonemes": "CandtA gozine ham midan",
|
| 30 |
+
"word_count_matches": true,
|
| 31 |
+
"duration_seconds": 1.5786666666666667
|
| 32 |
+
},
|
| 33 |
+
{
|
| 34 |
+
"text": "بعد مدل همین که به گزینه ها نگاه کنه ،",
|
| 35 |
+
"normalized": "بعد مدل همین که به گزینه ها نگاه کنه ،",
|
| 36 |
+
"phonemes": "bad model hamin ke be gozinehA negA kone",
|
| 37 |
+
"word_count_matches": false,
|
| 38 |
+
"duration_seconds": 2.56
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"text": "درصد احتمال هرگزینه رو میبینه،",
|
| 42 |
+
"normalized": "درصد احتمال هرگزینه رو میبینه،",
|
| 43 |
+
"phonemes": "darsad ehtemAle hargozine ro mibine",
|
| 44 |
+
"word_count_matches": true,
|
| 45 |
+
"duration_seconds": 2.4426666666666668
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"text": "بدون هیچ محاسبه اضافی",
|
| 49 |
+
"normalized": "بدون هیچ محاسبه اضافی",
|
| 50 |
+
"phonemes": "beduneye hiC mohAsebeye ezAfi",
|
| 51 |
+
"word_count_matches": true,
|
| 52 |
+
"duration_seconds": 1.9733333333333334
|
| 53 |
+
}
|
| 54 |
+
],
|
| 55 |
+
"duration_seconds": 17.412666666666667
|
| 56 |
+
}
|
examples/standalone.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e999d1a8078150b5063e2884a1039b5a26f9778b718310be7658055c40304c8b
|
| 3 |
+
size 1671696
|
frontend/added_tokens.json
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"<extra_id_0>": 259,
|
| 3 |
+
"<extra_id_100>": 359,
|
| 4 |
+
"<extra_id_101>": 360,
|
| 5 |
+
"<extra_id_102>": 361,
|
| 6 |
+
"<extra_id_103>": 362,
|
| 7 |
+
"<extra_id_104>": 363,
|
| 8 |
+
"<extra_id_105>": 364,
|
| 9 |
+
"<extra_id_106>": 365,
|
| 10 |
+
"<extra_id_107>": 366,
|
| 11 |
+
"<extra_id_108>": 367,
|
| 12 |
+
"<extra_id_109>": 368,
|
| 13 |
+
"<extra_id_10>": 269,
|
| 14 |
+
"<extra_id_110>": 369,
|
| 15 |
+
"<extra_id_111>": 370,
|
| 16 |
+
"<extra_id_112>": 371,
|
| 17 |
+
"<extra_id_113>": 372,
|
| 18 |
+
"<extra_id_114>": 373,
|
| 19 |
+
"<extra_id_115>": 374,
|
| 20 |
+
"<extra_id_116>": 375,
|
| 21 |
+
"<extra_id_117>": 376,
|
| 22 |
+
"<extra_id_118>": 377,
|
| 23 |
+
"<extra_id_119>": 378,
|
| 24 |
+
"<extra_id_11>": 270,
|
| 25 |
+
"<extra_id_120>": 379,
|
| 26 |
+
"<extra_id_121>": 380,
|
| 27 |
+
"<extra_id_122>": 381,
|
| 28 |
+
"<extra_id_123>": 382,
|
| 29 |
+
"<extra_id_124>": 383,
|
| 30 |
+
"<extra_id_12>": 271,
|
| 31 |
+
"<extra_id_13>": 272,
|
| 32 |
+
"<extra_id_14>": 273,
|
| 33 |
+
"<extra_id_15>": 274,
|
| 34 |
+
"<extra_id_16>": 275,
|
| 35 |
+
"<extra_id_17>": 276,
|
| 36 |
+
"<extra_id_18>": 277,
|
| 37 |
+
"<extra_id_19>": 278,
|
| 38 |
+
"<extra_id_1>": 260,
|
| 39 |
+
"<extra_id_20>": 279,
|
| 40 |
+
"<extra_id_21>": 280,
|
| 41 |
+
"<extra_id_22>": 281,
|
| 42 |
+
"<extra_id_23>": 282,
|
| 43 |
+
"<extra_id_24>": 283,
|
| 44 |
+
"<extra_id_25>": 284,
|
| 45 |
+
"<extra_id_26>": 285,
|
| 46 |
+
"<extra_id_27>": 286,
|
| 47 |
+
"<extra_id_28>": 287,
|
| 48 |
+
"<extra_id_29>": 288,
|
| 49 |
+
"<extra_id_2>": 261,
|
| 50 |
+
"<extra_id_30>": 289,
|
| 51 |
+
"<extra_id_31>": 290,
|
| 52 |
+
"<extra_id_32>": 291,
|
| 53 |
+
"<extra_id_33>": 292,
|
| 54 |
+
"<extra_id_34>": 293,
|
| 55 |
+
"<extra_id_35>": 294,
|
| 56 |
+
"<extra_id_36>": 295,
|
| 57 |
+
"<extra_id_37>": 296,
|
| 58 |
+
"<extra_id_38>": 297,
|
| 59 |
+
"<extra_id_39>": 298,
|
| 60 |
+
"<extra_id_3>": 262,
|
| 61 |
+
"<extra_id_40>": 299,
|
| 62 |
+
"<extra_id_41>": 300,
|
| 63 |
+
"<extra_id_42>": 301,
|
| 64 |
+
"<extra_id_43>": 302,
|
| 65 |
+
"<extra_id_44>": 303,
|
| 66 |
+
"<extra_id_45>": 304,
|
| 67 |
+
"<extra_id_46>": 305,
|
| 68 |
+
"<extra_id_47>": 306,
|
| 69 |
+
"<extra_id_48>": 307,
|
| 70 |
+
"<extra_id_49>": 308,
|
| 71 |
+
"<extra_id_4>": 263,
|
| 72 |
+
"<extra_id_50>": 309,
|
| 73 |
+
"<extra_id_51>": 310,
|
| 74 |
+
"<extra_id_52>": 311,
|
| 75 |
+
"<extra_id_53>": 312,
|
| 76 |
+
"<extra_id_54>": 313,
|
| 77 |
+
"<extra_id_55>": 314,
|
| 78 |
+
"<extra_id_56>": 315,
|
| 79 |
+
"<extra_id_57>": 316,
|
| 80 |
+
"<extra_id_58>": 317,
|
| 81 |
+
"<extra_id_59>": 318,
|
| 82 |
+
"<extra_id_5>": 264,
|
| 83 |
+
"<extra_id_60>": 319,
|
| 84 |
+
"<extra_id_61>": 320,
|
| 85 |
+
"<extra_id_62>": 321,
|
| 86 |
+
"<extra_id_63>": 322,
|
| 87 |
+
"<extra_id_64>": 323,
|
| 88 |
+
"<extra_id_65>": 324,
|
| 89 |
+
"<extra_id_66>": 325,
|
| 90 |
+
"<extra_id_67>": 326,
|
| 91 |
+
"<extra_id_68>": 327,
|
| 92 |
+
"<extra_id_69>": 328,
|
| 93 |
+
"<extra_id_6>": 265,
|
| 94 |
+
"<extra_id_70>": 329,
|
| 95 |
+
"<extra_id_71>": 330,
|
| 96 |
+
"<extra_id_72>": 331,
|
| 97 |
+
"<extra_id_73>": 332,
|
| 98 |
+
"<extra_id_74>": 333,
|
| 99 |
+
"<extra_id_75>": 334,
|
| 100 |
+
"<extra_id_76>": 335,
|
| 101 |
+
"<extra_id_77>": 336,
|
| 102 |
+
"<extra_id_78>": 337,
|
| 103 |
+
"<extra_id_79>": 338,
|
| 104 |
+
"<extra_id_7>": 266,
|
| 105 |
+
"<extra_id_80>": 339,
|
| 106 |
+
"<extra_id_81>": 340,
|
| 107 |
+
"<extra_id_82>": 341,
|
| 108 |
+
"<extra_id_83>": 342,
|
| 109 |
+
"<extra_id_84>": 343,
|
| 110 |
+
"<extra_id_85>": 344,
|
| 111 |
+
"<extra_id_86>": 345,
|
| 112 |
+
"<extra_id_87>": 346,
|
| 113 |
+
"<extra_id_88>": 347,
|
| 114 |
+
"<extra_id_89>": 348,
|
| 115 |
+
"<extra_id_8>": 267,
|
| 116 |
+
"<extra_id_90>": 349,
|
| 117 |
+
"<extra_id_91>": 350,
|
| 118 |
+
"<extra_id_92>": 351,
|
| 119 |
+
"<extra_id_93>": 352,
|
| 120 |
+
"<extra_id_94>": 353,
|
| 121 |
+
"<extra_id_95>": 354,
|
| 122 |
+
"<extra_id_96>": 355,
|
| 123 |
+
"<extra_id_97>": 356,
|
| 124 |
+
"<extra_id_98>": 357,
|
| 125 |
+
"<extra_id_99>": 358,
|
| 126 |
+
"<extra_id_9>": 268
|
| 127 |
+
}
|
frontend/config.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"T5ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"classifier_dropout": 0.0,
|
| 6 |
+
"d_ff": 512,
|
| 7 |
+
"d_kv": 64,
|
| 8 |
+
"d_model": 512,
|
| 9 |
+
"decoder_start_token_id": 0,
|
| 10 |
+
"dense_act_fn": "gelu_new",
|
| 11 |
+
"dropout_rate": 0.1,
|
| 12 |
+
"dtype": "float32",
|
| 13 |
+
"eos_token_id": 1,
|
| 14 |
+
"feed_forward_proj": "gated-gelu",
|
| 15 |
+
"gradient_checkpointing": false,
|
| 16 |
+
"initializer_factor": 1.0,
|
| 17 |
+
"is_encoder_decoder": true,
|
| 18 |
+
"is_gated_act": true,
|
| 19 |
+
"layer_norm_epsilon": 1e-06,
|
| 20 |
+
"model_type": "t5",
|
| 21 |
+
"num_decoder_layers": 2,
|
| 22 |
+
"num_heads": 6,
|
| 23 |
+
"num_layers": 2,
|
| 24 |
+
"pad_token_id": 0,
|
| 25 |
+
"relative_attention_max_distance": 128,
|
| 26 |
+
"relative_attention_num_buckets": 32,
|
| 27 |
+
"scale_decoder_outputs": false,
|
| 28 |
+
"tokenizer_class": "ByT5Tokenizer",
|
| 29 |
+
"transformers_version": "4.57.6",
|
| 30 |
+
"use_cache": false,
|
| 31 |
+
"vocab_size": 384
|
| 32 |
+
}
|
frontend/generation_config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"decoder_start_token_id": 0,
|
| 3 |
+
"eos_token_id": 1,
|
| 4 |
+
"pad_token_id": 0,
|
| 5 |
+
"transformers_version": "4.57.6"
|
| 6 |
+
}
|
frontend/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2d89883abe07082cfb291203c1e5609f8974e71ca04d6c3e73bf2d32f8b715cf
|
| 3 |
+
size 32275776
|
frontend/overlay.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"fallback":"preserve_negara_v7_output","matching":"exact_normalized_surface_and_exact_raw_repr1","overlay_sha256":"0759f09ef057eb6cc5fe64d7f5c3e589b577d3c6ecea9b8002809488ed7aad62","provenance":{"gemini_model":"google/gemini-3.6-flash","gemini_use":"admit a learned rule only when frozen Gemini phones exactly match the human phones","human_authoritative":true,"manual_canonical_rule_count":6,"votes_path":"gooya5-authoritative470-with-gemini.jsonl","votes_sha256":"9e897dfdc1e96dc521801f1dce43b64373fdf6c381813bc270eea2b7fb92b117"},"rules":[{"card_ids":["8f822288977092df91ec49e76073f9c47f2a16b1b7f61d99f4a2b176e4560eab"],"raw":"AghAyAn","source":"exact_human_gemini36_agreement","support":1,"surface":"آقایان","target":"AqAyAn"},{"card_ids":["1b2d8f9aa0d9ebba16e9385a5bbd6b887102bd1a21a0d7c6f839665192bf8f99","66c9bf5f9bf4b2970e897bbd3fc4c12731978314a69fccc0bc39e29169bf9caa"],"raw":"ama","source":"exact_human_gemini36_agreement","support":2,"surface":"اما","target":"amA"},{"card_ids":["45df52f659869151f7d9c677d2ac8ae714f4d2d76f42ffff7d5c76bc600351a2","a2b77f327c7e5a70d55966908579a1205c36617f5bc452f1b44030ec86a2c36a","a8c5a82843e124c9ea885e795502a38320c975e4791176c0d67aba8e0f2b7324"],"raw":"breil","source":"exact_human_gemini36_agreement","support":3,"surface":"بریل","target":"bereil"},{"card_ids":["627dfa3407bb5778e22ea7d61b61a48c28f5060a2c5505ce3ea217f6614989e6","baa2cd9a1bb5cb0150ec60cef7bbf1084184cdb784e2010d17fbe20ea5cc8afb"],"raw":"breile","source":"exact_human_gemini36_agreement","support":2,"surface":"بریل","target":"bereile"},{"card_ids":["d5089df4fd3e9eaf6ffeceb31d0e8bb83d05b45a53a57713453c866033b625b1"],"raw":"teleskopip","source":"exact_human_gemini36_agreement","support":1,"surface":"تلسکوپی","target":"teleskopi"},{"card_ids":["3f142b8596470886d7bb641b437fa575303e987917ba38491d472ea17f12a350"],"raw":"xorm","source":"exact_human_gemini36_agreement","support":1,"surface":"خرم","target":"xorram"},{"card_ids":["338bf447f6857caf048d0cce3313e56b99464343966db04c786dd7e528d2d87c"],"raw":"darbAreyeye","source":"exact_human_gemini36_agreement","support":1,"surface":"دربارۀ","target":"darbAreye"},{"card_ids":["a02f20288f8f60053e89343c35db96ffebdf95bc8e9aefbdc84ebecef0080d44"],"raw":"darangi","source":"exact_human_gemini36_agreement","support":1,"surface":"درنگی","target":"derangi"},{"card_ids":["4aef44d4d7bdae3beb403e418b045863f6cc3a5ed774da383d35e06000167f7e"],"raw":"dah","source":"exact_human_gemini36_agreement","support":1,"surface":"ده","target":"deh"},{"card_ids":["8df7f8a894595e53bb6f511db09487315444c8e1f8373d258da73f0e01b75efd"],"raw":"davist","source":"exact_human_gemini36_agreement","support":1,"surface":"دویست","target":"divist"},{"card_ids":["bd26d55116162127a948af4e8d5887ff4e07aedf1c38f030e08f37908a223ac1"],"raw":"rasidi","source":"exact_human_gemini36_agreement","support":1,"surface":"رسیدی","target":"residi"},{"card_ids":["579861c9c2cc88069e2f0fbe18c62f5541eda6dffdbb204040dedf2624cda1f5"],"raw":"sabb","source":"exact_human_gemini36_agreement","support":1,"surface":"سبب","target":"sabab"},{"card_ids":["a4ac7672f9217013f757554e506309af97f81c71baac11a1b1f8daaba5bda07e"],"raw":"send","source":"exact_human_gemini36_agreement","support":1,"surface":"سند","target":"sanad"},{"card_ids":["a9ba820e7c2bad36f23a4ed858f37fbe4fb10acd581238433218c1723dee3607"],"raw":"Sakiban","source":"exact_human_gemini36_agreement","support":1,"surface":"شکیبا","target":"SakibA"},{"card_ids":["068586a1fe3ade39e7fb88ff5b92387cfb0dd37c4f90eafa3da662e519ec8846"],"raw":"faaliyAthA","source":"exact_human_gemini36_agreement","support":1,"surface":"فعالیتها","target":"faAliyathA"},{"card_ids":["918787327d852669b476c294f9a7e2953e1c60c383df26350173364f642333ed"],"raw":"qoSqAyi","source":"exact_human_gemini36_agreement","support":1,"surface":"قشقایی","target":"qaSqAyi"},{"card_ids":["34fadc403460da8480ffe93e2ebd611cbb91a561b83b5ad275f37bc766835d52"],"raw":"qate","source":"exact_human_gemini36_agreement","support":1,"surface":"قطعه","target":"qetQe"},{"card_ids":["9e83b4c5aa60d49dcecb7b257c7cb7e60227d646528232791ee838e30954ab35"],"raw":"mAlkine","source":"exact_human_gemini36_agreement","support":1,"surface":"مالکین","target":"mAlekine"},{"card_ids":["8022af96bff5295c4fcdc3e33c3859274a33ed99bf295e9e5d3938e5a7547110"],"raw":"mAneyeye","source":"exact_human_gemini36_agreement","support":1,"surface":"مانع","target":"mAneQe"},{"card_ids":["34e6a7f9d75c00a0f7aca13ba549c47a8c60482939746ad2a54c04d24690e0b3"],"raw":"mAnandeye","source":"exact_human_gemini36_agreement","support":1,"surface":"مانند","target":"mAnande"},{"card_ids":["9e76f8d19c5e76a3607b88bdb4c72ddd2221dc55e08a3cef3cc09991f977f6d3"],"raw":"mAykrusAfat","source":"exact_human_gemini36_agreement","support":1,"surface":"مایکروسافت","target":"mAykrosAft"},{"card_ids":["2f3ac3e3827d04eee84aed082a1927e4eb023bdcac8cba4ee16372b017e7e8aa"],"raw":"navisexAne","source":"exact_human_gemini36_agreement","support":1,"surface":"نویسهخوان","target":"nevisexAne"},{"card_ids":["eaab528d56903607937aad088d043c5b58f51233d3938e9a87b0f50956ac592b"],"raw":"nakanid","source":"exact_human_gemini36_agreement","support":1,"surface":"نکنید","target":"nakonid"},{"card_ids":["463b8f7b90da42a258de2ecb8483de99a3cd6914f44140adbd7220bae9f435e5"],"raw":"negAye","source":"exact_human_gemini36_agreement","support":1,"surface":"نگاه","target":"negAhe"},{"card_ids":["d7142a09ccc8b220290695e0127fcbe2d5ceeaa4899eb4ec7260fd431390bfbc"],"raw":"viziat","source":"exact_human_gemini36_agreement","support":1,"surface":"ویزیت","target":"vizit"},{"card_ids":["984987c18e58e118eae9dc8463f36788bf2fefcf11d488e7150574ed49db5b34"],"raw":"parnur","source":"exact_human_gemini36_agreement","support":1,"surface":"پرنور","target":"pornur"},{"card_ids":["4c029e3894c59e7850fdd31ed09decc8bfc1022984d56e4278a4251330569a68"],"raw":"past","source":"exact_human_gemini36_agreement","support":1,"surface":"پست","target":"post"},{"card_ids":["96693d68ea30c10a3f2aabfe4501dc9d93f85cc25816ef188bfe078ef9762844"],"raw":"CaSme","source":"exact_human_gemini36_agreement","support":1,"surface":"چشم","target":"CeSme"},{"card_ids":["c1c3cf0b826768caf994af32f4c26912cb2b0a5e84342e9609be2caffa610d1f"],"raw":"kuseSaS","source":"exact_human_gemini36_agreement","support":1,"surface":"کوشش","target":"kuSeS"},{"raw":"alAq","source":"user_canonical_example","surface":"الاغ","target":"olAq"},{"raw":"alAqe","source":"user_canonical_example","surface":"الاغ","target":"olAqe"},{"raw":"salAme","source":"user_canonical_example","surface":"سلام","target":"salAm"},{"raw":"hAlat","source":"user_canonical_example","surface":"حالت","target":"hAlet"},{"raw":"Cetore","source":"user_canonical_example","surface":"چطوره","target":"Cetoreh"},{"raw":"ahvAlat","source":"user_canonical_example","surface":"احوالت","target":"ahvAlet"}],"schema_version":"negara.v7.1-human-gemini-overlay/v1"}
|
frontend/special_tokens_map.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"eos_token": {
|
| 3 |
+
"content": "</s>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": true,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"pad_token": {
|
| 10 |
+
"content": "<pad>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": true,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"unk_token": {
|
| 17 |
+
"content": "<unk>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": true,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
}
|
| 23 |
+
}
|
frontend/tokenizer_config.json
ADDED
|
@@ -0,0 +1,1040 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "<pad>",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": true,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"1": {
|
| 12 |
+
"content": "</s>",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": true,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"2": {
|
| 20 |
+
"content": "<unk>",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": true,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
},
|
| 27 |
+
"259": {
|
| 28 |
+
"content": "<extra_id_0>",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": true
|
| 34 |
+
},
|
| 35 |
+
"260": {
|
| 36 |
+
"content": "<extra_id_1>",
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
},
|
| 43 |
+
"261": {
|
| 44 |
+
"content": "<extra_id_2>",
|
| 45 |
+
"lstrip": false,
|
| 46 |
+
"normalized": false,
|
| 47 |
+
"rstrip": false,
|
| 48 |
+
"single_word": false,
|
| 49 |
+
"special": true
|
| 50 |
+
},
|
| 51 |
+
"262": {
|
| 52 |
+
"content": "<extra_id_3>",
|
| 53 |
+
"lstrip": false,
|
| 54 |
+
"normalized": false,
|
| 55 |
+
"rstrip": false,
|
| 56 |
+
"single_word": false,
|
| 57 |
+
"special": true
|
| 58 |
+
},
|
| 59 |
+
"263": {
|
| 60 |
+
"content": "<extra_id_4>",
|
| 61 |
+
"lstrip": false,
|
| 62 |
+
"normalized": false,
|
| 63 |
+
"rstrip": false,
|
| 64 |
+
"single_word": false,
|
| 65 |
+
"special": true
|
| 66 |
+
},
|
| 67 |
+
"264": {
|
| 68 |
+
"content": "<extra_id_5>",
|
| 69 |
+
"lstrip": false,
|
| 70 |
+
"normalized": false,
|
| 71 |
+
"rstrip": false,
|
| 72 |
+
"single_word": false,
|
| 73 |
+
"special": true
|
| 74 |
+
},
|
| 75 |
+
"265": {
|
| 76 |
+
"content": "<extra_id_6>",
|
| 77 |
+
"lstrip": false,
|
| 78 |
+
"normalized": false,
|
| 79 |
+
"rstrip": false,
|
| 80 |
+
"single_word": false,
|
| 81 |
+
"special": true
|
| 82 |
+
},
|
| 83 |
+
"266": {
|
| 84 |
+
"content": "<extra_id_7>",
|
| 85 |
+
"lstrip": false,
|
| 86 |
+
"normalized": false,
|
| 87 |
+
"rstrip": false,
|
| 88 |
+
"single_word": false,
|
| 89 |
+
"special": true
|
| 90 |
+
},
|
| 91 |
+
"267": {
|
| 92 |
+
"content": "<extra_id_8>",
|
| 93 |
+
"lstrip": false,
|
| 94 |
+
"normalized": false,
|
| 95 |
+
"rstrip": false,
|
| 96 |
+
"single_word": false,
|
| 97 |
+
"special": true
|
| 98 |
+
},
|
| 99 |
+
"268": {
|
| 100 |
+
"content": "<extra_id_9>",
|
| 101 |
+
"lstrip": false,
|
| 102 |
+
"normalized": false,
|
| 103 |
+
"rstrip": false,
|
| 104 |
+
"single_word": false,
|
| 105 |
+
"special": true
|
| 106 |
+
},
|
| 107 |
+
"269": {
|
| 108 |
+
"content": "<extra_id_10>",
|
| 109 |
+
"lstrip": false,
|
| 110 |
+
"normalized": false,
|
| 111 |
+
"rstrip": false,
|
| 112 |
+
"single_word": false,
|
| 113 |
+
"special": true
|
| 114 |
+
},
|
| 115 |
+
"270": {
|
| 116 |
+
"content": "<extra_id_11>",
|
| 117 |
+
"lstrip": false,
|
| 118 |
+
"normalized": false,
|
| 119 |
+
"rstrip": false,
|
| 120 |
+
"single_word": false,
|
| 121 |
+
"special": true
|
| 122 |
+
},
|
| 123 |
+
"271": {
|
| 124 |
+
"content": "<extra_id_12>",
|
| 125 |
+
"lstrip": false,
|
| 126 |
+
"normalized": false,
|
| 127 |
+
"rstrip": false,
|
| 128 |
+
"single_word": false,
|
| 129 |
+
"special": true
|
| 130 |
+
},
|
| 131 |
+
"272": {
|
| 132 |
+
"content": "<extra_id_13>",
|
| 133 |
+
"lstrip": false,
|
| 134 |
+
"normalized": false,
|
| 135 |
+
"rstrip": false,
|
| 136 |
+
"single_word": false,
|
| 137 |
+
"special": true
|
| 138 |
+
},
|
| 139 |
+
"273": {
|
| 140 |
+
"content": "<extra_id_14>",
|
| 141 |
+
"lstrip": false,
|
| 142 |
+
"normalized": false,
|
| 143 |
+
"rstrip": false,
|
| 144 |
+
"single_word": false,
|
| 145 |
+
"special": true
|
| 146 |
+
},
|
| 147 |
+
"274": {
|
| 148 |
+
"content": "<extra_id_15>",
|
| 149 |
+
"lstrip": false,
|
| 150 |
+
"normalized": false,
|
| 151 |
+
"rstrip": false,
|
| 152 |
+
"single_word": false,
|
| 153 |
+
"special": true
|
| 154 |
+
},
|
| 155 |
+
"275": {
|
| 156 |
+
"content": "<extra_id_16>",
|
| 157 |
+
"lstrip": false,
|
| 158 |
+
"normalized": false,
|
| 159 |
+
"rstrip": false,
|
| 160 |
+
"single_word": false,
|
| 161 |
+
"special": true
|
| 162 |
+
},
|
| 163 |
+
"276": {
|
| 164 |
+
"content": "<extra_id_17>",
|
| 165 |
+
"lstrip": false,
|
| 166 |
+
"normalized": false,
|
| 167 |
+
"rstrip": false,
|
| 168 |
+
"single_word": false,
|
| 169 |
+
"special": true
|
| 170 |
+
},
|
| 171 |
+
"277": {
|
| 172 |
+
"content": "<extra_id_18>",
|
| 173 |
+
"lstrip": false,
|
| 174 |
+
"normalized": false,
|
| 175 |
+
"rstrip": false,
|
| 176 |
+
"single_word": false,
|
| 177 |
+
"special": true
|
| 178 |
+
},
|
| 179 |
+
"278": {
|
| 180 |
+
"content": "<extra_id_19>",
|
| 181 |
+
"lstrip": false,
|
| 182 |
+
"normalized": false,
|
| 183 |
+
"rstrip": false,
|
| 184 |
+
"single_word": false,
|
| 185 |
+
"special": true
|
| 186 |
+
},
|
| 187 |
+
"279": {
|
| 188 |
+
"content": "<extra_id_20>",
|
| 189 |
+
"lstrip": false,
|
| 190 |
+
"normalized": false,
|
| 191 |
+
"rstrip": false,
|
| 192 |
+
"single_word": false,
|
| 193 |
+
"special": true
|
| 194 |
+
},
|
| 195 |
+
"280": {
|
| 196 |
+
"content": "<extra_id_21>",
|
| 197 |
+
"lstrip": false,
|
| 198 |
+
"normalized": false,
|
| 199 |
+
"rstrip": false,
|
| 200 |
+
"single_word": false,
|
| 201 |
+
"special": true
|
| 202 |
+
},
|
| 203 |
+
"281": {
|
| 204 |
+
"content": "<extra_id_22>",
|
| 205 |
+
"lstrip": false,
|
| 206 |
+
"normalized": false,
|
| 207 |
+
"rstrip": false,
|
| 208 |
+
"single_word": false,
|
| 209 |
+
"special": true
|
| 210 |
+
},
|
| 211 |
+
"282": {
|
| 212 |
+
"content": "<extra_id_23>",
|
| 213 |
+
"lstrip": false,
|
| 214 |
+
"normalized": false,
|
| 215 |
+
"rstrip": false,
|
| 216 |
+
"single_word": false,
|
| 217 |
+
"special": true
|
| 218 |
+
},
|
| 219 |
+
"283": {
|
| 220 |
+
"content": "<extra_id_24>",
|
| 221 |
+
"lstrip": false,
|
| 222 |
+
"normalized": false,
|
| 223 |
+
"rstrip": false,
|
| 224 |
+
"single_word": false,
|
| 225 |
+
"special": true
|
| 226 |
+
},
|
| 227 |
+
"284": {
|
| 228 |
+
"content": "<extra_id_25>",
|
| 229 |
+
"lstrip": false,
|
| 230 |
+
"normalized": false,
|
| 231 |
+
"rstrip": false,
|
| 232 |
+
"single_word": false,
|
| 233 |
+
"special": true
|
| 234 |
+
},
|
| 235 |
+
"285": {
|
| 236 |
+
"content": "<extra_id_26>",
|
| 237 |
+
"lstrip": false,
|
| 238 |
+
"normalized": false,
|
| 239 |
+
"rstrip": false,
|
| 240 |
+
"single_word": false,
|
| 241 |
+
"special": true
|
| 242 |
+
},
|
| 243 |
+
"286": {
|
| 244 |
+
"content": "<extra_id_27>",
|
| 245 |
+
"lstrip": false,
|
| 246 |
+
"normalized": false,
|
| 247 |
+
"rstrip": false,
|
| 248 |
+
"single_word": false,
|
| 249 |
+
"special": true
|
| 250 |
+
},
|
| 251 |
+
"287": {
|
| 252 |
+
"content": "<extra_id_28>",
|
| 253 |
+
"lstrip": false,
|
| 254 |
+
"normalized": false,
|
| 255 |
+
"rstrip": false,
|
| 256 |
+
"single_word": false,
|
| 257 |
+
"special": true
|
| 258 |
+
},
|
| 259 |
+
"288": {
|
| 260 |
+
"content": "<extra_id_29>",
|
| 261 |
+
"lstrip": false,
|
| 262 |
+
"normalized": false,
|
| 263 |
+
"rstrip": false,
|
| 264 |
+
"single_word": false,
|
| 265 |
+
"special": true
|
| 266 |
+
},
|
| 267 |
+
"289": {
|
| 268 |
+
"content": "<extra_id_30>",
|
| 269 |
+
"lstrip": false,
|
| 270 |
+
"normalized": false,
|
| 271 |
+
"rstrip": false,
|
| 272 |
+
"single_word": false,
|
| 273 |
+
"special": true
|
| 274 |
+
},
|
| 275 |
+
"290": {
|
| 276 |
+
"content": "<extra_id_31>",
|
| 277 |
+
"lstrip": false,
|
| 278 |
+
"normalized": false,
|
| 279 |
+
"rstrip": false,
|
| 280 |
+
"single_word": false,
|
| 281 |
+
"special": true
|
| 282 |
+
},
|
| 283 |
+
"291": {
|
| 284 |
+
"content": "<extra_id_32>",
|
| 285 |
+
"lstrip": false,
|
| 286 |
+
"normalized": false,
|
| 287 |
+
"rstrip": false,
|
| 288 |
+
"single_word": false,
|
| 289 |
+
"special": true
|
| 290 |
+
},
|
| 291 |
+
"292": {
|
| 292 |
+
"content": "<extra_id_33>",
|
| 293 |
+
"lstrip": false,
|
| 294 |
+
"normalized": false,
|
| 295 |
+
"rstrip": false,
|
| 296 |
+
"single_word": false,
|
| 297 |
+
"special": true
|
| 298 |
+
},
|
| 299 |
+
"293": {
|
| 300 |
+
"content": "<extra_id_34>",
|
| 301 |
+
"lstrip": false,
|
| 302 |
+
"normalized": false,
|
| 303 |
+
"rstrip": false,
|
| 304 |
+
"single_word": false,
|
| 305 |
+
"special": true
|
| 306 |
+
},
|
| 307 |
+
"294": {
|
| 308 |
+
"content": "<extra_id_35>",
|
| 309 |
+
"lstrip": false,
|
| 310 |
+
"normalized": false,
|
| 311 |
+
"rstrip": false,
|
| 312 |
+
"single_word": false,
|
| 313 |
+
"special": true
|
| 314 |
+
},
|
| 315 |
+
"295": {
|
| 316 |
+
"content": "<extra_id_36>",
|
| 317 |
+
"lstrip": false,
|
| 318 |
+
"normalized": false,
|
| 319 |
+
"rstrip": false,
|
| 320 |
+
"single_word": false,
|
| 321 |
+
"special": true
|
| 322 |
+
},
|
| 323 |
+
"296": {
|
| 324 |
+
"content": "<extra_id_37>",
|
| 325 |
+
"lstrip": false,
|
| 326 |
+
"normalized": false,
|
| 327 |
+
"rstrip": false,
|
| 328 |
+
"single_word": false,
|
| 329 |
+
"special": true
|
| 330 |
+
},
|
| 331 |
+
"297": {
|
| 332 |
+
"content": "<extra_id_38>",
|
| 333 |
+
"lstrip": false,
|
| 334 |
+
"normalized": false,
|
| 335 |
+
"rstrip": false,
|
| 336 |
+
"single_word": false,
|
| 337 |
+
"special": true
|
| 338 |
+
},
|
| 339 |
+
"298": {
|
| 340 |
+
"content": "<extra_id_39>",
|
| 341 |
+
"lstrip": false,
|
| 342 |
+
"normalized": false,
|
| 343 |
+
"rstrip": false,
|
| 344 |
+
"single_word": false,
|
| 345 |
+
"special": true
|
| 346 |
+
},
|
| 347 |
+
"299": {
|
| 348 |
+
"content": "<extra_id_40>",
|
| 349 |
+
"lstrip": false,
|
| 350 |
+
"normalized": false,
|
| 351 |
+
"rstrip": false,
|
| 352 |
+
"single_word": false,
|
| 353 |
+
"special": true
|
| 354 |
+
},
|
| 355 |
+
"300": {
|
| 356 |
+
"content": "<extra_id_41>",
|
| 357 |
+
"lstrip": false,
|
| 358 |
+
"normalized": false,
|
| 359 |
+
"rstrip": false,
|
| 360 |
+
"single_word": false,
|
| 361 |
+
"special": true
|
| 362 |
+
},
|
| 363 |
+
"301": {
|
| 364 |
+
"content": "<extra_id_42>",
|
| 365 |
+
"lstrip": false,
|
| 366 |
+
"normalized": false,
|
| 367 |
+
"rstrip": false,
|
| 368 |
+
"single_word": false,
|
| 369 |
+
"special": true
|
| 370 |
+
},
|
| 371 |
+
"302": {
|
| 372 |
+
"content": "<extra_id_43>",
|
| 373 |
+
"lstrip": false,
|
| 374 |
+
"normalized": false,
|
| 375 |
+
"rstrip": false,
|
| 376 |
+
"single_word": false,
|
| 377 |
+
"special": true
|
| 378 |
+
},
|
| 379 |
+
"303": {
|
| 380 |
+
"content": "<extra_id_44>",
|
| 381 |
+
"lstrip": false,
|
| 382 |
+
"normalized": false,
|
| 383 |
+
"rstrip": false,
|
| 384 |
+
"single_word": false,
|
| 385 |
+
"special": true
|
| 386 |
+
},
|
| 387 |
+
"304": {
|
| 388 |
+
"content": "<extra_id_45>",
|
| 389 |
+
"lstrip": false,
|
| 390 |
+
"normalized": false,
|
| 391 |
+
"rstrip": false,
|
| 392 |
+
"single_word": false,
|
| 393 |
+
"special": true
|
| 394 |
+
},
|
| 395 |
+
"305": {
|
| 396 |
+
"content": "<extra_id_46>",
|
| 397 |
+
"lstrip": false,
|
| 398 |
+
"normalized": false,
|
| 399 |
+
"rstrip": false,
|
| 400 |
+
"single_word": false,
|
| 401 |
+
"special": true
|
| 402 |
+
},
|
| 403 |
+
"306": {
|
| 404 |
+
"content": "<extra_id_47>",
|
| 405 |
+
"lstrip": false,
|
| 406 |
+
"normalized": false,
|
| 407 |
+
"rstrip": false,
|
| 408 |
+
"single_word": false,
|
| 409 |
+
"special": true
|
| 410 |
+
},
|
| 411 |
+
"307": {
|
| 412 |
+
"content": "<extra_id_48>",
|
| 413 |
+
"lstrip": false,
|
| 414 |
+
"normalized": false,
|
| 415 |
+
"rstrip": false,
|
| 416 |
+
"single_word": false,
|
| 417 |
+
"special": true
|
| 418 |
+
},
|
| 419 |
+
"308": {
|
| 420 |
+
"content": "<extra_id_49>",
|
| 421 |
+
"lstrip": false,
|
| 422 |
+
"normalized": false,
|
| 423 |
+
"rstrip": false,
|
| 424 |
+
"single_word": false,
|
| 425 |
+
"special": true
|
| 426 |
+
},
|
| 427 |
+
"309": {
|
| 428 |
+
"content": "<extra_id_50>",
|
| 429 |
+
"lstrip": false,
|
| 430 |
+
"normalized": false,
|
| 431 |
+
"rstrip": false,
|
| 432 |
+
"single_word": false,
|
| 433 |
+
"special": true
|
| 434 |
+
},
|
| 435 |
+
"310": {
|
| 436 |
+
"content": "<extra_id_51>",
|
| 437 |
+
"lstrip": false,
|
| 438 |
+
"normalized": false,
|
| 439 |
+
"rstrip": false,
|
| 440 |
+
"single_word": false,
|
| 441 |
+
"special": true
|
| 442 |
+
},
|
| 443 |
+
"311": {
|
| 444 |
+
"content": "<extra_id_52>",
|
| 445 |
+
"lstrip": false,
|
| 446 |
+
"normalized": false,
|
| 447 |
+
"rstrip": false,
|
| 448 |
+
"single_word": false,
|
| 449 |
+
"special": true
|
| 450 |
+
},
|
| 451 |
+
"312": {
|
| 452 |
+
"content": "<extra_id_53>",
|
| 453 |
+
"lstrip": false,
|
| 454 |
+
"normalized": false,
|
| 455 |
+
"rstrip": false,
|
| 456 |
+
"single_word": false,
|
| 457 |
+
"special": true
|
| 458 |
+
},
|
| 459 |
+
"313": {
|
| 460 |
+
"content": "<extra_id_54>",
|
| 461 |
+
"lstrip": false,
|
| 462 |
+
"normalized": false,
|
| 463 |
+
"rstrip": false,
|
| 464 |
+
"single_word": false,
|
| 465 |
+
"special": true
|
| 466 |
+
},
|
| 467 |
+
"314": {
|
| 468 |
+
"content": "<extra_id_55>",
|
| 469 |
+
"lstrip": false,
|
| 470 |
+
"normalized": false,
|
| 471 |
+
"rstrip": false,
|
| 472 |
+
"single_word": false,
|
| 473 |
+
"special": true
|
| 474 |
+
},
|
| 475 |
+
"315": {
|
| 476 |
+
"content": "<extra_id_56>",
|
| 477 |
+
"lstrip": false,
|
| 478 |
+
"normalized": false,
|
| 479 |
+
"rstrip": false,
|
| 480 |
+
"single_word": false,
|
| 481 |
+
"special": true
|
| 482 |
+
},
|
| 483 |
+
"316": {
|
| 484 |
+
"content": "<extra_id_57>",
|
| 485 |
+
"lstrip": false,
|
| 486 |
+
"normalized": false,
|
| 487 |
+
"rstrip": false,
|
| 488 |
+
"single_word": false,
|
| 489 |
+
"special": true
|
| 490 |
+
},
|
| 491 |
+
"317": {
|
| 492 |
+
"content": "<extra_id_58>",
|
| 493 |
+
"lstrip": false,
|
| 494 |
+
"normalized": false,
|
| 495 |
+
"rstrip": false,
|
| 496 |
+
"single_word": false,
|
| 497 |
+
"special": true
|
| 498 |
+
},
|
| 499 |
+
"318": {
|
| 500 |
+
"content": "<extra_id_59>",
|
| 501 |
+
"lstrip": false,
|
| 502 |
+
"normalized": false,
|
| 503 |
+
"rstrip": false,
|
| 504 |
+
"single_word": false,
|
| 505 |
+
"special": true
|
| 506 |
+
},
|
| 507 |
+
"319": {
|
| 508 |
+
"content": "<extra_id_60>",
|
| 509 |
+
"lstrip": false,
|
| 510 |
+
"normalized": false,
|
| 511 |
+
"rstrip": false,
|
| 512 |
+
"single_word": false,
|
| 513 |
+
"special": true
|
| 514 |
+
},
|
| 515 |
+
"320": {
|
| 516 |
+
"content": "<extra_id_61>",
|
| 517 |
+
"lstrip": false,
|
| 518 |
+
"normalized": false,
|
| 519 |
+
"rstrip": false,
|
| 520 |
+
"single_word": false,
|
| 521 |
+
"special": true
|
| 522 |
+
},
|
| 523 |
+
"321": {
|
| 524 |
+
"content": "<extra_id_62>",
|
| 525 |
+
"lstrip": false,
|
| 526 |
+
"normalized": false,
|
| 527 |
+
"rstrip": false,
|
| 528 |
+
"single_word": false,
|
| 529 |
+
"special": true
|
| 530 |
+
},
|
| 531 |
+
"322": {
|
| 532 |
+
"content": "<extra_id_63>",
|
| 533 |
+
"lstrip": false,
|
| 534 |
+
"normalized": false,
|
| 535 |
+
"rstrip": false,
|
| 536 |
+
"single_word": false,
|
| 537 |
+
"special": true
|
| 538 |
+
},
|
| 539 |
+
"323": {
|
| 540 |
+
"content": "<extra_id_64>",
|
| 541 |
+
"lstrip": false,
|
| 542 |
+
"normalized": false,
|
| 543 |
+
"rstrip": false,
|
| 544 |
+
"single_word": false,
|
| 545 |
+
"special": true
|
| 546 |
+
},
|
| 547 |
+
"324": {
|
| 548 |
+
"content": "<extra_id_65>",
|
| 549 |
+
"lstrip": false,
|
| 550 |
+
"normalized": false,
|
| 551 |
+
"rstrip": false,
|
| 552 |
+
"single_word": false,
|
| 553 |
+
"special": true
|
| 554 |
+
},
|
| 555 |
+
"325": {
|
| 556 |
+
"content": "<extra_id_66>",
|
| 557 |
+
"lstrip": false,
|
| 558 |
+
"normalized": false,
|
| 559 |
+
"rstrip": false,
|
| 560 |
+
"single_word": false,
|
| 561 |
+
"special": true
|
| 562 |
+
},
|
| 563 |
+
"326": {
|
| 564 |
+
"content": "<extra_id_67>",
|
| 565 |
+
"lstrip": false,
|
| 566 |
+
"normalized": false,
|
| 567 |
+
"rstrip": false,
|
| 568 |
+
"single_word": false,
|
| 569 |
+
"special": true
|
| 570 |
+
},
|
| 571 |
+
"327": {
|
| 572 |
+
"content": "<extra_id_68>",
|
| 573 |
+
"lstrip": false,
|
| 574 |
+
"normalized": false,
|
| 575 |
+
"rstrip": false,
|
| 576 |
+
"single_word": false,
|
| 577 |
+
"special": true
|
| 578 |
+
},
|
| 579 |
+
"328": {
|
| 580 |
+
"content": "<extra_id_69>",
|
| 581 |
+
"lstrip": false,
|
| 582 |
+
"normalized": false,
|
| 583 |
+
"rstrip": false,
|
| 584 |
+
"single_word": false,
|
| 585 |
+
"special": true
|
| 586 |
+
},
|
| 587 |
+
"329": {
|
| 588 |
+
"content": "<extra_id_70>",
|
| 589 |
+
"lstrip": false,
|
| 590 |
+
"normalized": false,
|
| 591 |
+
"rstrip": false,
|
| 592 |
+
"single_word": false,
|
| 593 |
+
"special": true
|
| 594 |
+
},
|
| 595 |
+
"330": {
|
| 596 |
+
"content": "<extra_id_71>",
|
| 597 |
+
"lstrip": false,
|
| 598 |
+
"normalized": false,
|
| 599 |
+
"rstrip": false,
|
| 600 |
+
"single_word": false,
|
| 601 |
+
"special": true
|
| 602 |
+
},
|
| 603 |
+
"331": {
|
| 604 |
+
"content": "<extra_id_72>",
|
| 605 |
+
"lstrip": false,
|
| 606 |
+
"normalized": false,
|
| 607 |
+
"rstrip": false,
|
| 608 |
+
"single_word": false,
|
| 609 |
+
"special": true
|
| 610 |
+
},
|
| 611 |
+
"332": {
|
| 612 |
+
"content": "<extra_id_73>",
|
| 613 |
+
"lstrip": false,
|
| 614 |
+
"normalized": false,
|
| 615 |
+
"rstrip": false,
|
| 616 |
+
"single_word": false,
|
| 617 |
+
"special": true
|
| 618 |
+
},
|
| 619 |
+
"333": {
|
| 620 |
+
"content": "<extra_id_74>",
|
| 621 |
+
"lstrip": false,
|
| 622 |
+
"normalized": false,
|
| 623 |
+
"rstrip": false,
|
| 624 |
+
"single_word": false,
|
| 625 |
+
"special": true
|
| 626 |
+
},
|
| 627 |
+
"334": {
|
| 628 |
+
"content": "<extra_id_75>",
|
| 629 |
+
"lstrip": false,
|
| 630 |
+
"normalized": false,
|
| 631 |
+
"rstrip": false,
|
| 632 |
+
"single_word": false,
|
| 633 |
+
"special": true
|
| 634 |
+
},
|
| 635 |
+
"335": {
|
| 636 |
+
"content": "<extra_id_76>",
|
| 637 |
+
"lstrip": false,
|
| 638 |
+
"normalized": false,
|
| 639 |
+
"rstrip": false,
|
| 640 |
+
"single_word": false,
|
| 641 |
+
"special": true
|
| 642 |
+
},
|
| 643 |
+
"336": {
|
| 644 |
+
"content": "<extra_id_77>",
|
| 645 |
+
"lstrip": false,
|
| 646 |
+
"normalized": false,
|
| 647 |
+
"rstrip": false,
|
| 648 |
+
"single_word": false,
|
| 649 |
+
"special": true
|
| 650 |
+
},
|
| 651 |
+
"337": {
|
| 652 |
+
"content": "<extra_id_78>",
|
| 653 |
+
"lstrip": false,
|
| 654 |
+
"normalized": false,
|
| 655 |
+
"rstrip": false,
|
| 656 |
+
"single_word": false,
|
| 657 |
+
"special": true
|
| 658 |
+
},
|
| 659 |
+
"338": {
|
| 660 |
+
"content": "<extra_id_79>",
|
| 661 |
+
"lstrip": false,
|
| 662 |
+
"normalized": false,
|
| 663 |
+
"rstrip": false,
|
| 664 |
+
"single_word": false,
|
| 665 |
+
"special": true
|
| 666 |
+
},
|
| 667 |
+
"339": {
|
| 668 |
+
"content": "<extra_id_80>",
|
| 669 |
+
"lstrip": false,
|
| 670 |
+
"normalized": false,
|
| 671 |
+
"rstrip": false,
|
| 672 |
+
"single_word": false,
|
| 673 |
+
"special": true
|
| 674 |
+
},
|
| 675 |
+
"340": {
|
| 676 |
+
"content": "<extra_id_81>",
|
| 677 |
+
"lstrip": false,
|
| 678 |
+
"normalized": false,
|
| 679 |
+
"rstrip": false,
|
| 680 |
+
"single_word": false,
|
| 681 |
+
"special": true
|
| 682 |
+
},
|
| 683 |
+
"341": {
|
| 684 |
+
"content": "<extra_id_82>",
|
| 685 |
+
"lstrip": false,
|
| 686 |
+
"normalized": false,
|
| 687 |
+
"rstrip": false,
|
| 688 |
+
"single_word": false,
|
| 689 |
+
"special": true
|
| 690 |
+
},
|
| 691 |
+
"342": {
|
| 692 |
+
"content": "<extra_id_83>",
|
| 693 |
+
"lstrip": false,
|
| 694 |
+
"normalized": false,
|
| 695 |
+
"rstrip": false,
|
| 696 |
+
"single_word": false,
|
| 697 |
+
"special": true
|
| 698 |
+
},
|
| 699 |
+
"343": {
|
| 700 |
+
"content": "<extra_id_84>",
|
| 701 |
+
"lstrip": false,
|
| 702 |
+
"normalized": false,
|
| 703 |
+
"rstrip": false,
|
| 704 |
+
"single_word": false,
|
| 705 |
+
"special": true
|
| 706 |
+
},
|
| 707 |
+
"344": {
|
| 708 |
+
"content": "<extra_id_85>",
|
| 709 |
+
"lstrip": false,
|
| 710 |
+
"normalized": false,
|
| 711 |
+
"rstrip": false,
|
| 712 |
+
"single_word": false,
|
| 713 |
+
"special": true
|
| 714 |
+
},
|
| 715 |
+
"345": {
|
| 716 |
+
"content": "<extra_id_86>",
|
| 717 |
+
"lstrip": false,
|
| 718 |
+
"normalized": false,
|
| 719 |
+
"rstrip": false,
|
| 720 |
+
"single_word": false,
|
| 721 |
+
"special": true
|
| 722 |
+
},
|
| 723 |
+
"346": {
|
| 724 |
+
"content": "<extra_id_87>",
|
| 725 |
+
"lstrip": false,
|
| 726 |
+
"normalized": false,
|
| 727 |
+
"rstrip": false,
|
| 728 |
+
"single_word": false,
|
| 729 |
+
"special": true
|
| 730 |
+
},
|
| 731 |
+
"347": {
|
| 732 |
+
"content": "<extra_id_88>",
|
| 733 |
+
"lstrip": false,
|
| 734 |
+
"normalized": false,
|
| 735 |
+
"rstrip": false,
|
| 736 |
+
"single_word": false,
|
| 737 |
+
"special": true
|
| 738 |
+
},
|
| 739 |
+
"348": {
|
| 740 |
+
"content": "<extra_id_89>",
|
| 741 |
+
"lstrip": false,
|
| 742 |
+
"normalized": false,
|
| 743 |
+
"rstrip": false,
|
| 744 |
+
"single_word": false,
|
| 745 |
+
"special": true
|
| 746 |
+
},
|
| 747 |
+
"349": {
|
| 748 |
+
"content": "<extra_id_90>",
|
| 749 |
+
"lstrip": false,
|
| 750 |
+
"normalized": false,
|
| 751 |
+
"rstrip": false,
|
| 752 |
+
"single_word": false,
|
| 753 |
+
"special": true
|
| 754 |
+
},
|
| 755 |
+
"350": {
|
| 756 |
+
"content": "<extra_id_91>",
|
| 757 |
+
"lstrip": false,
|
| 758 |
+
"normalized": false,
|
| 759 |
+
"rstrip": false,
|
| 760 |
+
"single_word": false,
|
| 761 |
+
"special": true
|
| 762 |
+
},
|
| 763 |
+
"351": {
|
| 764 |
+
"content": "<extra_id_92>",
|
| 765 |
+
"lstrip": false,
|
| 766 |
+
"normalized": false,
|
| 767 |
+
"rstrip": false,
|
| 768 |
+
"single_word": false,
|
| 769 |
+
"special": true
|
| 770 |
+
},
|
| 771 |
+
"352": {
|
| 772 |
+
"content": "<extra_id_93>",
|
| 773 |
+
"lstrip": false,
|
| 774 |
+
"normalized": false,
|
| 775 |
+
"rstrip": false,
|
| 776 |
+
"single_word": false,
|
| 777 |
+
"special": true
|
| 778 |
+
},
|
| 779 |
+
"353": {
|
| 780 |
+
"content": "<extra_id_94>",
|
| 781 |
+
"lstrip": false,
|
| 782 |
+
"normalized": false,
|
| 783 |
+
"rstrip": false,
|
| 784 |
+
"single_word": false,
|
| 785 |
+
"special": true
|
| 786 |
+
},
|
| 787 |
+
"354": {
|
| 788 |
+
"content": "<extra_id_95>",
|
| 789 |
+
"lstrip": false,
|
| 790 |
+
"normalized": false,
|
| 791 |
+
"rstrip": false,
|
| 792 |
+
"single_word": false,
|
| 793 |
+
"special": true
|
| 794 |
+
},
|
| 795 |
+
"355": {
|
| 796 |
+
"content": "<extra_id_96>",
|
| 797 |
+
"lstrip": false,
|
| 798 |
+
"normalized": false,
|
| 799 |
+
"rstrip": false,
|
| 800 |
+
"single_word": false,
|
| 801 |
+
"special": true
|
| 802 |
+
},
|
| 803 |
+
"356": {
|
| 804 |
+
"content": "<extra_id_97>",
|
| 805 |
+
"lstrip": false,
|
| 806 |
+
"normalized": false,
|
| 807 |
+
"rstrip": false,
|
| 808 |
+
"single_word": false,
|
| 809 |
+
"special": true
|
| 810 |
+
},
|
| 811 |
+
"357": {
|
| 812 |
+
"content": "<extra_id_98>",
|
| 813 |
+
"lstrip": false,
|
| 814 |
+
"normalized": false,
|
| 815 |
+
"rstrip": false,
|
| 816 |
+
"single_word": false,
|
| 817 |
+
"special": true
|
| 818 |
+
},
|
| 819 |
+
"358": {
|
| 820 |
+
"content": "<extra_id_99>",
|
| 821 |
+
"lstrip": false,
|
| 822 |
+
"normalized": false,
|
| 823 |
+
"rstrip": false,
|
| 824 |
+
"single_word": false,
|
| 825 |
+
"special": true
|
| 826 |
+
},
|
| 827 |
+
"359": {
|
| 828 |
+
"content": "<extra_id_100>",
|
| 829 |
+
"lstrip": false,
|
| 830 |
+
"normalized": false,
|
| 831 |
+
"rstrip": false,
|
| 832 |
+
"single_word": false,
|
| 833 |
+
"special": true
|
| 834 |
+
},
|
| 835 |
+
"360": {
|
| 836 |
+
"content": "<extra_id_101>",
|
| 837 |
+
"lstrip": false,
|
| 838 |
+
"normalized": false,
|
| 839 |
+
"rstrip": false,
|
| 840 |
+
"single_word": false,
|
| 841 |
+
"special": true
|
| 842 |
+
},
|
| 843 |
+
"361": {
|
| 844 |
+
"content": "<extra_id_102>",
|
| 845 |
+
"lstrip": false,
|
| 846 |
+
"normalized": false,
|
| 847 |
+
"rstrip": false,
|
| 848 |
+
"single_word": false,
|
| 849 |
+
"special": true
|
| 850 |
+
},
|
| 851 |
+
"362": {
|
| 852 |
+
"content": "<extra_id_103>",
|
| 853 |
+
"lstrip": false,
|
| 854 |
+
"normalized": false,
|
| 855 |
+
"rstrip": false,
|
| 856 |
+
"single_word": false,
|
| 857 |
+
"special": true
|
| 858 |
+
},
|
| 859 |
+
"363": {
|
| 860 |
+
"content": "<extra_id_104>",
|
| 861 |
+
"lstrip": false,
|
| 862 |
+
"normalized": false,
|
| 863 |
+
"rstrip": false,
|
| 864 |
+
"single_word": false,
|
| 865 |
+
"special": true
|
| 866 |
+
},
|
| 867 |
+
"364": {
|
| 868 |
+
"content": "<extra_id_105>",
|
| 869 |
+
"lstrip": false,
|
| 870 |
+
"normalized": false,
|
| 871 |
+
"rstrip": false,
|
| 872 |
+
"single_word": false,
|
| 873 |
+
"special": true
|
| 874 |
+
},
|
| 875 |
+
"365": {
|
| 876 |
+
"content": "<extra_id_106>",
|
| 877 |
+
"lstrip": false,
|
| 878 |
+
"normalized": false,
|
| 879 |
+
"rstrip": false,
|
| 880 |
+
"single_word": false,
|
| 881 |
+
"special": true
|
| 882 |
+
},
|
| 883 |
+
"366": {
|
| 884 |
+
"content": "<extra_id_107>",
|
| 885 |
+
"lstrip": false,
|
| 886 |
+
"normalized": false,
|
| 887 |
+
"rstrip": false,
|
| 888 |
+
"single_word": false,
|
| 889 |
+
"special": true
|
| 890 |
+
},
|
| 891 |
+
"367": {
|
| 892 |
+
"content": "<extra_id_108>",
|
| 893 |
+
"lstrip": false,
|
| 894 |
+
"normalized": false,
|
| 895 |
+
"rstrip": false,
|
| 896 |
+
"single_word": false,
|
| 897 |
+
"special": true
|
| 898 |
+
},
|
| 899 |
+
"368": {
|
| 900 |
+
"content": "<extra_id_109>",
|
| 901 |
+
"lstrip": false,
|
| 902 |
+
"normalized": false,
|
| 903 |
+
"rstrip": false,
|
| 904 |
+
"single_word": false,
|
| 905 |
+
"special": true
|
| 906 |
+
},
|
| 907 |
+
"369": {
|
| 908 |
+
"content": "<extra_id_110>",
|
| 909 |
+
"lstrip": false,
|
| 910 |
+
"normalized": false,
|
| 911 |
+
"rstrip": false,
|
| 912 |
+
"single_word": false,
|
| 913 |
+
"special": true
|
| 914 |
+
},
|
| 915 |
+
"370": {
|
| 916 |
+
"content": "<extra_id_111>",
|
| 917 |
+
"lstrip": false,
|
| 918 |
+
"normalized": false,
|
| 919 |
+
"rstrip": false,
|
| 920 |
+
"single_word": false,
|
| 921 |
+
"special": true
|
| 922 |
+
},
|
| 923 |
+
"371": {
|
| 924 |
+
"content": "<extra_id_112>",
|
| 925 |
+
"lstrip": false,
|
| 926 |
+
"normalized": false,
|
| 927 |
+
"rstrip": false,
|
| 928 |
+
"single_word": false,
|
| 929 |
+
"special": true
|
| 930 |
+
},
|
| 931 |
+
"372": {
|
| 932 |
+
"content": "<extra_id_113>",
|
| 933 |
+
"lstrip": false,
|
| 934 |
+
"normalized": false,
|
| 935 |
+
"rstrip": false,
|
| 936 |
+
"single_word": false,
|
| 937 |
+
"special": true
|
| 938 |
+
},
|
| 939 |
+
"373": {
|
| 940 |
+
"content": "<extra_id_114>",
|
| 941 |
+
"lstrip": false,
|
| 942 |
+
"normalized": false,
|
| 943 |
+
"rstrip": false,
|
| 944 |
+
"single_word": false,
|
| 945 |
+
"special": true
|
| 946 |
+
},
|
| 947 |
+
"374": {
|
| 948 |
+
"content": "<extra_id_115>",
|
| 949 |
+
"lstrip": false,
|
| 950 |
+
"normalized": false,
|
| 951 |
+
"rstrip": false,
|
| 952 |
+
"single_word": false,
|
| 953 |
+
"special": true
|
| 954 |
+
},
|
| 955 |
+
"375": {
|
| 956 |
+
"content": "<extra_id_116>",
|
| 957 |
+
"lstrip": false,
|
| 958 |
+
"normalized": false,
|
| 959 |
+
"rstrip": false,
|
| 960 |
+
"single_word": false,
|
| 961 |
+
"special": true
|
| 962 |
+
},
|
| 963 |
+
"376": {
|
| 964 |
+
"content": "<extra_id_117>",
|
| 965 |
+
"lstrip": false,
|
| 966 |
+
"normalized": false,
|
| 967 |
+
"rstrip": false,
|
| 968 |
+
"single_word": false,
|
| 969 |
+
"special": true
|
| 970 |
+
},
|
| 971 |
+
"377": {
|
| 972 |
+
"content": "<extra_id_118>",
|
| 973 |
+
"lstrip": false,
|
| 974 |
+
"normalized": false,
|
| 975 |
+
"rstrip": false,
|
| 976 |
+
"single_word": false,
|
| 977 |
+
"special": true
|
| 978 |
+
},
|
| 979 |
+
"378": {
|
| 980 |
+
"content": "<extra_id_119>",
|
| 981 |
+
"lstrip": false,
|
| 982 |
+
"normalized": false,
|
| 983 |
+
"rstrip": false,
|
| 984 |
+
"single_word": false,
|
| 985 |
+
"special": true
|
| 986 |
+
},
|
| 987 |
+
"379": {
|
| 988 |
+
"content": "<extra_id_120>",
|
| 989 |
+
"lstrip": false,
|
| 990 |
+
"normalized": false,
|
| 991 |
+
"rstrip": false,
|
| 992 |
+
"single_word": false,
|
| 993 |
+
"special": true
|
| 994 |
+
},
|
| 995 |
+
"380": {
|
| 996 |
+
"content": "<extra_id_121>",
|
| 997 |
+
"lstrip": false,
|
| 998 |
+
"normalized": false,
|
| 999 |
+
"rstrip": false,
|
| 1000 |
+
"single_word": false,
|
| 1001 |
+
"special": true
|
| 1002 |
+
},
|
| 1003 |
+
"381": {
|
| 1004 |
+
"content": "<extra_id_122>",
|
| 1005 |
+
"lstrip": false,
|
| 1006 |
+
"normalized": false,
|
| 1007 |
+
"rstrip": false,
|
| 1008 |
+
"single_word": false,
|
| 1009 |
+
"special": true
|
| 1010 |
+
},
|
| 1011 |
+
"382": {
|
| 1012 |
+
"content": "<extra_id_123>",
|
| 1013 |
+
"lstrip": false,
|
| 1014 |
+
"normalized": false,
|
| 1015 |
+
"rstrip": false,
|
| 1016 |
+
"single_word": false,
|
| 1017 |
+
"special": true
|
| 1018 |
+
},
|
| 1019 |
+
"383": {
|
| 1020 |
+
"content": "<extra_id_124>",
|
| 1021 |
+
"lstrip": false,
|
| 1022 |
+
"normalized": false,
|
| 1023 |
+
"rstrip": false,
|
| 1024 |
+
"single_word": false,
|
| 1025 |
+
"special": true
|
| 1026 |
+
}
|
| 1027 |
+
},
|
| 1028 |
+
"additional_special_tokens": [],
|
| 1029 |
+
"backend": "custom",
|
| 1030 |
+
"clean_up_tokenization_spaces": false,
|
| 1031 |
+
"eos_token": "</s>",
|
| 1032 |
+
"extra_ids": 0,
|
| 1033 |
+
"extra_special_tokens": {},
|
| 1034 |
+
"is_local": false,
|
| 1035 |
+
"local_files_only": false,
|
| 1036 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 1037 |
+
"pad_token": "<pad>",
|
| 1038 |
+
"tokenizer_class": "ByT5Tokenizer",
|
| 1039 |
+
"unk_token": "<unk>"
|
| 1040 |
+
}
|
gooya_config.json
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "Gooya-RizehPizeh-v2-exp",
|
| 3 |
+
"sample_rate": 24000,
|
| 4 |
+
"n_mels": 100,
|
| 5 |
+
"hop_length": 256,
|
| 6 |
+
"parameters": {
|
| 7 |
+
"total": 9451575,
|
| 8 |
+
"acoustic": 437685,
|
| 9 |
+
"vocoder": 946434,
|
| 10 |
+
"g2p": 8067456
|
| 11 |
+
},
|
| 12 |
+
"frontend": {
|
| 13 |
+
"num_beams": 5,
|
| 14 |
+
"max_new_tokens": 512,
|
| 15 |
+
"overlay": true
|
| 16 |
+
},
|
| 17 |
+
"vocabulary": {
|
| 18 |
+
"<pad>": 0,
|
| 19 |
+
"A": 1,
|
| 20 |
+
"C": 2,
|
| 21 |
+
"Q": 3,
|
| 22 |
+
"S": 4,
|
| 23 |
+
"Z": 5,
|
| 24 |
+
"a": 6,
|
| 25 |
+
"b": 7,
|
| 26 |
+
"c": 8,
|
| 27 |
+
"d": 9,
|
| 28 |
+
"e": 10,
|
| 29 |
+
"f": 11,
|
| 30 |
+
"g": 12,
|
| 31 |
+
"h": 13,
|
| 32 |
+
"i": 14,
|
| 33 |
+
"j": 15,
|
| 34 |
+
"k": 16,
|
| 35 |
+
"l": 17,
|
| 36 |
+
"m": 18,
|
| 37 |
+
"n": 19,
|
| 38 |
+
"o": 20,
|
| 39 |
+
"p": 21,
|
| 40 |
+
"q": 22,
|
| 41 |
+
"r": 23,
|
| 42 |
+
"s": 24,
|
| 43 |
+
"t": 25,
|
| 44 |
+
"u": 26,
|
| 45 |
+
"v": 27,
|
| 46 |
+
"x": 28,
|
| 47 |
+
"y": 29,
|
| 48 |
+
"z": 30,
|
| 49 |
+
"<sil>": 31,
|
| 50 |
+
"<wb>": 32,
|
| 51 |
+
"<comma>": 33,
|
| 52 |
+
"<stop>": 34
|
| 53 |
+
},
|
| 54 |
+
"stats": {
|
| 55 |
+
"pitch": [
|
| 56 |
+
-4.268602197682544,
|
| 57 |
+
9.7447582834536,
|
| 58 |
+
236.40021959281708,
|
| 59 |
+
55.38117834478943
|
| 60 |
+
],
|
| 61 |
+
"energy": [
|
| 62 |
+
-1.383905377099731,
|
| 63 |
+
15.066260915460015,
|
| 64 |
+
19.318673053037664,
|
| 65 |
+
13.959533196932918
|
| 66 |
+
],
|
| 67 |
+
"mel_mean": [
|
| 68 |
+
-1.2599120962399815,
|
| 69 |
+
-1.0706863130203852,
|
| 70 |
+
-1.3486225483807173,
|
| 71 |
+
-1.7726936082089029,
|
| 72 |
+
-2.041859880321682,
|
| 73 |
+
-1.712638320035706,
|
| 74 |
+
-1.0914770279327108,
|
| 75 |
+
-0.3807035679628814,
|
| 76 |
+
0.07982043833775036,
|
| 77 |
+
0.22480345288187137,
|
| 78 |
+
-0.055095117517642914,
|
| 79 |
+
-0.44897131882475627,
|
| 80 |
+
-0.6456663869845404,
|
| 81 |
+
-0.757075913214885,
|
| 82 |
+
-0.6418275830384098,
|
| 83 |
+
-0.6876451645425007,
|
| 84 |
+
-0.5022434700565953,
|
| 85 |
+
-0.5589231758789743,
|
| 86 |
+
-0.7308565946682717,
|
| 87 |
+
-0.6738371803222432,
|
| 88 |
+
-0.6591148241863097,
|
| 89 |
+
-0.5883852729898147,
|
| 90 |
+
-0.5639190191526563,
|
| 91 |
+
-0.7877885209264643,
|
| 92 |
+
-0.8651297569802631,
|
| 93 |
+
-0.9135138596372251,
|
| 94 |
+
-0.9160686679274491,
|
| 95 |
+
-1.0026051861303737,
|
| 96 |
+
-1.1595387866912998,
|
| 97 |
+
-1.3463762292503894,
|
| 98 |
+
-1.433785481625953,
|
| 99 |
+
-1.509796948289812,
|
| 100 |
+
-1.5532702188077707,
|
| 101 |
+
-1.58031571677792,
|
| 102 |
+
-1.5848189295037685,
|
| 103 |
+
-1.53389185687708,
|
| 104 |
+
-1.6147262252995764,
|
| 105 |
+
-1.5244208106009025,
|
| 106 |
+
-1.5246441635814538,
|
| 107 |
+
-1.404755357976768,
|
| 108 |
+
-1.2746636397949307,
|
| 109 |
+
-1.2552575190198396,
|
| 110 |
+
-1.2390230013675123,
|
| 111 |
+
-1.2408969273842558,
|
| 112 |
+
-1.2593803586363268,
|
| 113 |
+
-1.2886173993373498,
|
| 114 |
+
-1.3755037817316689,
|
| 115 |
+
-1.489770602358068,
|
| 116 |
+
-1.5264167721939668,
|
| 117 |
+
-1.5668277704132214,
|
| 118 |
+
-1.485083786356484,
|
| 119 |
+
-1.3851185974497089,
|
| 120 |
+
-1.3471519688882847,
|
| 121 |
+
-1.355141926671464,
|
| 122 |
+
-1.366675977216914,
|
| 123 |
+
-1.378138861126079,
|
| 124 |
+
-1.426072925184457,
|
| 125 |
+
-1.4807474690972087,
|
| 126 |
+
-1.5874296346188488,
|
| 127 |
+
-1.7006418388046916,
|
| 128 |
+
-1.8353564094266106,
|
| 129 |
+
-1.9317527992801704,
|
| 130 |
+
-1.9428357752375198,
|
| 131 |
+
-1.883040283595134,
|
| 132 |
+
-1.7377132245251883,
|
| 133 |
+
-1.5972257115773942,
|
| 134 |
+
-1.4810687983142867,
|
| 135 |
+
-1.444813686563024,
|
| 136 |
+
-1.4722089856505978,
|
| 137 |
+
-1.50291586943949,
|
| 138 |
+
-1.5512569720723524,
|
| 139 |
+
-1.6538890198503444,
|
| 140 |
+
-1.817821647804874,
|
| 141 |
+
-2.0399388252424093,
|
| 142 |
+
-2.2701647154375406,
|
| 143 |
+
-2.5035088520641633,
|
| 144 |
+
-2.6186066993318593,
|
| 145 |
+
-2.6823086870228656,
|
| 146 |
+
-2.682087813068936,
|
| 147 |
+
-2.7183459479868217,
|
| 148 |
+
-2.5509733317896353,
|
| 149 |
+
-2.1603005679802307,
|
| 150 |
+
-1.8111598191860174,
|
| 151 |
+
-1.621251966300455,
|
| 152 |
+
-1.6408059785839708,
|
| 153 |
+
-1.9298176242428915,
|
| 154 |
+
-2.4191385805562073,
|
| 155 |
+
-2.9964079875197016,
|
| 156 |
+
-2.9862544853959996,
|
| 157 |
+
-3.2133091665313294,
|
| 158 |
+
-3.915077464403742,
|
| 159 |
+
-5.339607711801079,
|
| 160 |
+
-6.822064941222431,
|
| 161 |
+
-7.397338695634322,
|
| 162 |
+
-7.699124545520323,
|
| 163 |
+
-7.589487886694324,
|
| 164 |
+
-7.834026533757323,
|
| 165 |
+
-7.592484212990957,
|
| 166 |
+
-7.787868553571219,
|
| 167 |
+
-7.700824718443493
|
| 168 |
+
]
|
| 169 |
+
},
|
| 170 |
+
"vocoder_config": {
|
| 171 |
+
"resblock": "1",
|
| 172 |
+
"num_gpus": 0,
|
| 173 |
+
"batch_size": 16,
|
| 174 |
+
"learning_rate": 0.0002,
|
| 175 |
+
"adam_b1": 0.8,
|
| 176 |
+
"adam_b2": 0.99,
|
| 177 |
+
"lr_decay": 0.999,
|
| 178 |
+
"seed": 1234,
|
| 179 |
+
"upsample_rates": [
|
| 180 |
+
8,
|
| 181 |
+
8,
|
| 182 |
+
2,
|
| 183 |
+
2
|
| 184 |
+
],
|
| 185 |
+
"upsample_kernel_sizes": [
|
| 186 |
+
16,
|
| 187 |
+
16,
|
| 188 |
+
4,
|
| 189 |
+
4
|
| 190 |
+
],
|
| 191 |
+
"upsample_initial_channel": 128,
|
| 192 |
+
"resblock_kernel_sizes": [
|
| 193 |
+
3,
|
| 194 |
+
7,
|
| 195 |
+
11
|
| 196 |
+
],
|
| 197 |
+
"resblock_dilation_sizes": [
|
| 198 |
+
[
|
| 199 |
+
1,
|
| 200 |
+
3,
|
| 201 |
+
5
|
| 202 |
+
],
|
| 203 |
+
[
|
| 204 |
+
1,
|
| 205 |
+
3,
|
| 206 |
+
5
|
| 207 |
+
],
|
| 208 |
+
[
|
| 209 |
+
1,
|
| 210 |
+
3,
|
| 211 |
+
5
|
| 212 |
+
]
|
| 213 |
+
],
|
| 214 |
+
"resblock_initial_channel": 64,
|
| 215 |
+
"segment_size": 8192,
|
| 216 |
+
"num_mels": 100,
|
| 217 |
+
"num_freq": 1025,
|
| 218 |
+
"n_fft": 1024,
|
| 219 |
+
"hop_size": 256,
|
| 220 |
+
"win_size": 1024,
|
| 221 |
+
"sampling_rate": 24000,
|
| 222 |
+
"fmin": 0,
|
| 223 |
+
"fmax": 12000,
|
| 224 |
+
"fmax_loss": null,
|
| 225 |
+
"num_workers": 4,
|
| 226 |
+
"dist_config": {
|
| 227 |
+
"dist_backend": "nccl",
|
| 228 |
+
"dist_url": "tcp://localhost:54321",
|
| 229 |
+
"world_size": 1
|
| 230 |
+
}
|
| 231 |
+
},
|
| 232 |
+
"comma_gap_seconds": 0.15,
|
| 233 |
+
"sentence_gap_seconds": 0.3
|
| 234 |
+
}
|
gooya_tts/__init__.py
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from .runtime import GooyaTTS
|
| 2 |
+
__all__ = ["GooyaTTS"]
|
gooya_tts/hifigan.py
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
import torch.nn.functional as F
|
| 3 |
+
import torch.nn as nn
|
| 4 |
+
from torch.nn import Conv1d, ConvTranspose1d, AvgPool1d, Conv2d
|
| 5 |
+
from torch.nn.utils import weight_norm, remove_weight_norm, spectral_norm
|
| 6 |
+
#from utils import init_weights, get_padding
|
| 7 |
+
|
| 8 |
+
def init_weights(m, mean=0.0, std=0.01):
|
| 9 |
+
classname = m.__class__.__name__
|
| 10 |
+
if classname.find("Conv") != -1:
|
| 11 |
+
m.weight.data.normal_(mean, std)
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
def get_padding(kernel_size, dilation=1):
|
| 15 |
+
return int((kernel_size * dilation - dilation) / 2)
|
| 16 |
+
|
| 17 |
+
LRELU_SLOPE = 0.1
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class ResBlock1(torch.nn.Module):
|
| 21 |
+
def __init__(self, h, channels, kernel_size=3, dilation=(1, 3, 5)):
|
| 22 |
+
super(ResBlock1, self).__init__()
|
| 23 |
+
self.h = h
|
| 24 |
+
self.convs1 = nn.ModuleList([
|
| 25 |
+
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=dilation[0],
|
| 26 |
+
padding=get_padding(kernel_size, dilation[0]))),
|
| 27 |
+
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=dilation[1],
|
| 28 |
+
padding=get_padding(kernel_size, dilation[1]))),
|
| 29 |
+
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=dilation[2],
|
| 30 |
+
padding=get_padding(kernel_size, dilation[2])))
|
| 31 |
+
])
|
| 32 |
+
self.convs1.apply(init_weights)
|
| 33 |
+
|
| 34 |
+
self.convs2 = nn.ModuleList([
|
| 35 |
+
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=1,
|
| 36 |
+
padding=get_padding(kernel_size, 1))),
|
| 37 |
+
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=1,
|
| 38 |
+
padding=get_padding(kernel_size, 1))),
|
| 39 |
+
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=1,
|
| 40 |
+
padding=get_padding(kernel_size, 1)))
|
| 41 |
+
])
|
| 42 |
+
self.convs2.apply(init_weights)
|
| 43 |
+
|
| 44 |
+
def forward(self, x):
|
| 45 |
+
for c1, c2 in zip(self.convs1, self.convs2):
|
| 46 |
+
xt = F.leaky_relu(x, LRELU_SLOPE)
|
| 47 |
+
xt = c1(xt)
|
| 48 |
+
xt = F.leaky_relu(xt, LRELU_SLOPE)
|
| 49 |
+
xt = c2(xt)
|
| 50 |
+
x = xt + x
|
| 51 |
+
return x
|
| 52 |
+
|
| 53 |
+
def remove_weight_norm(self):
|
| 54 |
+
for l in self.convs1:
|
| 55 |
+
remove_weight_norm(l)
|
| 56 |
+
for l in self.convs2:
|
| 57 |
+
remove_weight_norm(l)
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
class ResBlock2(torch.nn.Module):
|
| 61 |
+
def __init__(self, h, channels, kernel_size=3, dilation=(1, 3)):
|
| 62 |
+
super(ResBlock2, self).__init__()
|
| 63 |
+
self.h = h
|
| 64 |
+
self.convs = nn.ModuleList([
|
| 65 |
+
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=dilation[0],
|
| 66 |
+
padding=get_padding(kernel_size, dilation[0]))),
|
| 67 |
+
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=dilation[1],
|
| 68 |
+
padding=get_padding(kernel_size, dilation[1])))
|
| 69 |
+
])
|
| 70 |
+
self.convs.apply(init_weights)
|
| 71 |
+
|
| 72 |
+
def forward(self, x):
|
| 73 |
+
for c in self.convs:
|
| 74 |
+
xt = F.leaky_relu(x, LRELU_SLOPE)
|
| 75 |
+
xt = c(xt)
|
| 76 |
+
x = xt + x
|
| 77 |
+
return x
|
| 78 |
+
|
| 79 |
+
def remove_weight_norm(self):
|
| 80 |
+
for l in self.convs:
|
| 81 |
+
remove_weight_norm(l)
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
class Generator(torch.nn.Module):
|
| 85 |
+
def __init__(self, h):
|
| 86 |
+
super(Generator, self).__init__()
|
| 87 |
+
self.h = h
|
| 88 |
+
self.num_kernels = len(h.resblock_kernel_sizes)
|
| 89 |
+
self.num_upsamples = len(h.upsample_rates)
|
| 90 |
+
self.conv_pre = weight_norm(Conv1d(80, h.upsample_initial_channel, 7, 1, padding=3))
|
| 91 |
+
resblock = ResBlock1 if h.resblock == '1' else ResBlock2
|
| 92 |
+
|
| 93 |
+
self.ups = nn.ModuleList()
|
| 94 |
+
for i, (u, k) in enumerate(zip(h.upsample_rates, h.upsample_kernel_sizes)):
|
| 95 |
+
self.ups.append(weight_norm(
|
| 96 |
+
ConvTranspose1d(h.upsample_initial_channel//(2**i), h.upsample_initial_channel//(2**(i+1)),
|
| 97 |
+
k, u, padding=(k-u)//2)))
|
| 98 |
+
|
| 99 |
+
self.resblocks = nn.ModuleList()
|
| 100 |
+
for i in range(len(self.ups)):
|
| 101 |
+
ch = h.upsample_initial_channel//(2**(i+1))
|
| 102 |
+
for j, (k, d) in enumerate(zip(h.resblock_kernel_sizes, h.resblock_dilation_sizes)):
|
| 103 |
+
self.resblocks.append(resblock(h, ch, k, d))
|
| 104 |
+
|
| 105 |
+
self.conv_post = weight_norm(Conv1d(ch, 1, 7, 1, padding=3))
|
| 106 |
+
self.ups.apply(init_weights)
|
| 107 |
+
self.conv_post.apply(init_weights)
|
| 108 |
+
|
| 109 |
+
def forward(self, x):
|
| 110 |
+
x = self.conv_pre(x)
|
| 111 |
+
for i in range(self.num_upsamples):
|
| 112 |
+
x = F.leaky_relu(x, LRELU_SLOPE)
|
| 113 |
+
x = self.ups[i](x)
|
| 114 |
+
xs = None
|
| 115 |
+
for j in range(self.num_kernels):
|
| 116 |
+
if xs is None:
|
| 117 |
+
xs = self.resblocks[i*self.num_kernels+j](x)
|
| 118 |
+
else:
|
| 119 |
+
xs += self.resblocks[i*self.num_kernels+j](x)
|
| 120 |
+
x = xs / self.num_kernels
|
| 121 |
+
x = F.leaky_relu(x)
|
| 122 |
+
x = self.conv_post(x)
|
| 123 |
+
x = torch.tanh(x)
|
| 124 |
+
|
| 125 |
+
return x
|
| 126 |
+
|
| 127 |
+
def remove_weight_norm(self):
|
| 128 |
+
print('Removing weight norm...')
|
| 129 |
+
for l in self.ups:
|
| 130 |
+
remove_weight_norm(l)
|
| 131 |
+
for l in self.resblocks:
|
| 132 |
+
l.remove_weight_norm()
|
| 133 |
+
remove_weight_norm(self.conv_pre)
|
| 134 |
+
remove_weight_norm(self.conv_post)
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
class DiscriminatorP(torch.nn.Module):
|
| 138 |
+
def __init__(self, period, kernel_size=5, stride=3, use_spectral_norm=False):
|
| 139 |
+
super(DiscriminatorP, self).__init__()
|
| 140 |
+
self.period = period
|
| 141 |
+
norm_f = weight_norm if use_spectral_norm == False else spectral_norm
|
| 142 |
+
self.convs = nn.ModuleList([
|
| 143 |
+
norm_f(Conv2d(1, 32, (kernel_size, 1), (stride, 1), padding=(get_padding(5, 1), 0))),
|
| 144 |
+
norm_f(Conv2d(32, 128, (kernel_size, 1), (stride, 1), padding=(get_padding(5, 1), 0))),
|
| 145 |
+
norm_f(Conv2d(128, 512, (kernel_size, 1), (stride, 1), padding=(get_padding(5, 1), 0))),
|
| 146 |
+
norm_f(Conv2d(512, 1024, (kernel_size, 1), (stride, 1), padding=(get_padding(5, 1), 0))),
|
| 147 |
+
norm_f(Conv2d(1024, 1024, (kernel_size, 1), 1, padding=(2, 0))),
|
| 148 |
+
])
|
| 149 |
+
self.conv_post = norm_f(Conv2d(1024, 1, (3, 1), 1, padding=(1, 0)))
|
| 150 |
+
|
| 151 |
+
def forward(self, x):
|
| 152 |
+
fmap = []
|
| 153 |
+
|
| 154 |
+
# 1d to 2d
|
| 155 |
+
b, c, t = x.shape
|
| 156 |
+
if t % self.period != 0: # pad first
|
| 157 |
+
n_pad = self.period - (t % self.period)
|
| 158 |
+
x = F.pad(x, (0, n_pad), "reflect")
|
| 159 |
+
t = t + n_pad
|
| 160 |
+
x = x.view(b, c, t // self.period, self.period)
|
| 161 |
+
|
| 162 |
+
for l in self.convs:
|
| 163 |
+
x = l(x)
|
| 164 |
+
x = F.leaky_relu(x, LRELU_SLOPE)
|
| 165 |
+
fmap.append(x)
|
| 166 |
+
x = self.conv_post(x)
|
| 167 |
+
fmap.append(x)
|
| 168 |
+
x = torch.flatten(x, 1, -1)
|
| 169 |
+
|
| 170 |
+
return x, fmap
|
| 171 |
+
|
| 172 |
+
|
| 173 |
+
class MultiPeriodDiscriminator(torch.nn.Module):
|
| 174 |
+
def __init__(self):
|
| 175 |
+
super(MultiPeriodDiscriminator, self).__init__()
|
| 176 |
+
self.discriminators = nn.ModuleList([
|
| 177 |
+
DiscriminatorP(2),
|
| 178 |
+
DiscriminatorP(3),
|
| 179 |
+
DiscriminatorP(5),
|
| 180 |
+
DiscriminatorP(7),
|
| 181 |
+
DiscriminatorP(11),
|
| 182 |
+
])
|
| 183 |
+
|
| 184 |
+
def forward(self, y, y_hat):
|
| 185 |
+
y_d_rs = []
|
| 186 |
+
y_d_gs = []
|
| 187 |
+
fmap_rs = []
|
| 188 |
+
fmap_gs = []
|
| 189 |
+
for i, d in enumerate(self.discriminators):
|
| 190 |
+
y_d_r, fmap_r = d(y)
|
| 191 |
+
y_d_g, fmap_g = d(y_hat)
|
| 192 |
+
y_d_rs.append(y_d_r)
|
| 193 |
+
fmap_rs.append(fmap_r)
|
| 194 |
+
y_d_gs.append(y_d_g)
|
| 195 |
+
fmap_gs.append(fmap_g)
|
| 196 |
+
|
| 197 |
+
return y_d_rs, y_d_gs, fmap_rs, fmap_gs
|
| 198 |
+
|
| 199 |
+
|
| 200 |
+
class DiscriminatorS(torch.nn.Module):
|
| 201 |
+
def __init__(self, use_spectral_norm=False):
|
| 202 |
+
super(DiscriminatorS, self).__init__()
|
| 203 |
+
norm_f = weight_norm if use_spectral_norm == False else spectral_norm
|
| 204 |
+
self.convs = nn.ModuleList([
|
| 205 |
+
norm_f(Conv1d(1, 128, 15, 1, padding=7)),
|
| 206 |
+
norm_f(Conv1d(128, 128, 41, 2, groups=4, padding=20)),
|
| 207 |
+
norm_f(Conv1d(128, 256, 41, 2, groups=16, padding=20)),
|
| 208 |
+
norm_f(Conv1d(256, 512, 41, 4, groups=16, padding=20)),
|
| 209 |
+
norm_f(Conv1d(512, 1024, 41, 4, groups=16, padding=20)),
|
| 210 |
+
norm_f(Conv1d(1024, 1024, 41, 1, groups=16, padding=20)),
|
| 211 |
+
norm_f(Conv1d(1024, 1024, 5, 1, padding=2)),
|
| 212 |
+
])
|
| 213 |
+
self.conv_post = norm_f(Conv1d(1024, 1, 3, 1, padding=1))
|
| 214 |
+
|
| 215 |
+
def forward(self, x):
|
| 216 |
+
fmap = []
|
| 217 |
+
for l in self.convs:
|
| 218 |
+
x = l(x)
|
| 219 |
+
x = F.leaky_relu(x, LRELU_SLOPE)
|
| 220 |
+
fmap.append(x)
|
| 221 |
+
x = self.conv_post(x)
|
| 222 |
+
fmap.append(x)
|
| 223 |
+
x = torch.flatten(x, 1, -1)
|
| 224 |
+
|
| 225 |
+
return x, fmap
|
| 226 |
+
|
| 227 |
+
|
| 228 |
+
class MultiScaleDiscriminator(torch.nn.Module):
|
| 229 |
+
def __init__(self):
|
| 230 |
+
super(MultiScaleDiscriminator, self).__init__()
|
| 231 |
+
self.discriminators = nn.ModuleList([
|
| 232 |
+
DiscriminatorS(use_spectral_norm=True),
|
| 233 |
+
DiscriminatorS(),
|
| 234 |
+
DiscriminatorS(),
|
| 235 |
+
])
|
| 236 |
+
self.meanpools = nn.ModuleList([
|
| 237 |
+
AvgPool1d(4, 2, padding=2),
|
| 238 |
+
AvgPool1d(4, 2, padding=2)
|
| 239 |
+
])
|
| 240 |
+
|
| 241 |
+
def forward(self, y, y_hat):
|
| 242 |
+
y_d_rs = []
|
| 243 |
+
y_d_gs = []
|
| 244 |
+
fmap_rs = []
|
| 245 |
+
fmap_gs = []
|
| 246 |
+
for i, d in enumerate(self.discriminators):
|
| 247 |
+
if i != 0:
|
| 248 |
+
y = self.meanpools[i-1](y)
|
| 249 |
+
y_hat = self.meanpools[i-1](y_hat)
|
| 250 |
+
y_d_r, fmap_r = d(y)
|
| 251 |
+
y_d_g, fmap_g = d(y_hat)
|
| 252 |
+
y_d_rs.append(y_d_r)
|
| 253 |
+
fmap_rs.append(fmap_r)
|
| 254 |
+
y_d_gs.append(y_d_g)
|
| 255 |
+
fmap_gs.append(fmap_g)
|
| 256 |
+
|
| 257 |
+
return y_d_rs, y_d_gs, fmap_rs, fmap_gs
|
| 258 |
+
|
| 259 |
+
|
| 260 |
+
def feature_loss(fmap_r, fmap_g):
|
| 261 |
+
loss = 0
|
| 262 |
+
for dr, dg in zip(fmap_r, fmap_g):
|
| 263 |
+
for rl, gl in zip(dr, dg):
|
| 264 |
+
loss += torch.mean(torch.abs(rl - gl))
|
| 265 |
+
|
| 266 |
+
return loss*2
|
| 267 |
+
|
| 268 |
+
|
| 269 |
+
def discriminator_loss(disc_real_outputs, disc_generated_outputs):
|
| 270 |
+
loss = 0
|
| 271 |
+
r_losses = []
|
| 272 |
+
g_losses = []
|
| 273 |
+
for dr, dg in zip(disc_real_outputs, disc_generated_outputs):
|
| 274 |
+
r_loss = torch.mean((1-dr)**2)
|
| 275 |
+
g_loss = torch.mean(dg**2)
|
| 276 |
+
loss += (r_loss + g_loss)
|
| 277 |
+
r_losses.append(r_loss.item())
|
| 278 |
+
g_losses.append(g_loss.item())
|
| 279 |
+
|
| 280 |
+
return loss, r_losses, g_losses
|
| 281 |
+
|
| 282 |
+
|
| 283 |
+
def generator_loss(disc_outputs):
|
| 284 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plore.ieee.org/abstract/document/10094639
|
| 4 |
+
Rowel Atienza
|
| 5 |
+
Apache 2.0 License
|
| 6 |
+
2023
|
| 7 |
+
'''
|
| 8 |
+
|
| 9 |
+
import torch
|
| 10 |
+
import torch.nn.functional as F
|
| 11 |
+
from torch import nn
|
| 12 |
+
symbols = [] # Replaced by the packaged Persian vocabulary during construction.
|
| 13 |
+
from einops import repeat
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class DynamicTanh(nn.Module):
|
| 21 |
+
def __init__(
|
| 22 |
+
self,
|
| 23 |
+
normalized_shape,
|
| 24 |
+
channels_last=True,
|
| 25 |
+
alpha_init_value=0.5,
|
| 26 |
+
activation="tanh",
|
| 27 |
+
):
|
| 28 |
+
super().__init__()
|
| 29 |
+
self.normalized_shape = normalized_shape
|
| 30 |
+
self.alpha_init_value = alpha_init_value
|
| 31 |
+
self.channels_last = channels_last
|
| 32 |
+
self.activation = activation
|
| 33 |
+
|
| 34 |
+
self.alpha = nn.Parameter(torch.ones(1) * alpha_init_value)
|
| 35 |
+
self.weight = nn.Parameter(torch.ones(normalized_shape))
|
| 36 |
+
self.bias = nn.Parameter(torch.zeros(normalized_shape))
|
| 37 |
+
|
| 38 |
+
def splitanh(self, x):
|
| 39 |
+
a = 0.75
|
| 40 |
+
B = 1.25
|
| 41 |
+
|
| 42 |
+
z = self.alpha * x
|
| 43 |
+
u = torch.abs(z)
|
| 44 |
+
sign = torch.sign(z)
|
| 45 |
+
|
| 46 |
+
t = (u - a) / (B - a)
|
| 47 |
+
y_turn = a + (1 - a) * (2 * t - t * t)
|
| 48 |
+
|
| 49 |
+
y_abs = torch.where(u <= a, u, y_turn)
|
| 50 |
+
y_abs = torch.where(u >= B, torch.ones_like(u), y_abs)
|
| 51 |
+
|
| 52 |
+
return sign * y_abs
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
def forward(self, x):
|
| 56 |
+
if self.activation == "splitanh":
|
| 57 |
+
x = self.splitanh(x)
|
| 58 |
+
else:
|
| 59 |
+
x = torch.tanh(self.alpha * x)
|
| 60 |
+
if self.channels_last:
|
| 61 |
+
x = x * self.weight + self.bias
|
| 62 |
+
else:
|
| 63 |
+
x = x * self.weight[:, None, None] + self.bias[:, None, None]
|
| 64 |
+
return x
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
class Encoder(nn.Module):
|
| 70 |
+
""" Phoneme Encoder """
|
| 71 |
+
|
| 72 |
+
def __init__(self):
|
| 73 |
+
super().__init__()
|
| 74 |
+
|
| 75 |
+
embed_dim=80
|
| 76 |
+
kernel_size=5
|
| 77 |
+
dim_out = 32
|
| 78 |
+
self.embed = nn.Embedding(len(symbols) + 1, embed_dim, padding_idx=0)
|
| 79 |
+
self.b1_conv1 = nn.Conv1d(embed_dim, embed_dim, kernel_size=kernel_size, padding=kernel_size // 2)
|
| 80 |
+
self.b1_dyt1 = DynamicTanh(embed_dim)
|
| 81 |
+
self.b1_conv2 = nn.Conv1d(embed_dim, embed_dim, kernel_size=kernel_size, padding=kernel_size // 2)
|
| 82 |
+
self.b1_dyt2 = DynamicTanh(embed_dim)
|
| 83 |
+
self.b2_conv1 = nn.Conv1d(embed_dim, embed_dim, kernel_size=kernel_size, padding=kernel_size // 2)
|
| 84 |
+
self.b2_dyt1 = DynamicTanh(embed_dim)
|
| 85 |
+
self.b2_conv2 = nn.Conv1d(embed_dim, embed_dim, kernel_size=kernel_size, padding=kernel_size // 2)
|
| 86 |
+
self.b2_dyt2 = DynamicTanh(embed_dim)
|
| 87 |
+
self.linear = nn.Linear(embed_dim, dim_out)
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
def forward(self, phoneme, mask=None):
|
| 91 |
+
|
| 92 |
+
skip = self.embed(phoneme)
|
| 93 |
+
|
| 94 |
+
x = skip.permute(0, 2, 1)
|
| 95 |
+
x = self.b1_conv1(x)
|
| 96 |
+
x = x.permute(0, 2, 1)
|
| 97 |
+
x = self.b1_dyt1(x)
|
| 98 |
+
x = x.permute(0, 2, 1)
|
| 99 |
+
x = self.b1_conv2(x)
|
| 100 |
+
x = x.permute(0, 2, 1)
|
| 101 |
+
x = self.b1_dyt2(x+skip)
|
| 102 |
+
|
| 103 |
+
skip = x
|
| 104 |
+
x = skip.permute(0, 2, 1)
|
| 105 |
+
x = self.b2_conv1(x)
|
| 106 |
+
x = x.permute(0, 2, 1)
|
| 107 |
+
x = self.b2_dyt1(x)
|
| 108 |
+
x = x.permute(0, 2, 1)
|
| 109 |
+
x = self.b2_conv2(x)
|
| 110 |
+
x = x.permute(0, 2, 1)
|
| 111 |
+
x = self.b2_dyt2(x+skip)
|
| 112 |
+
x_32 = self.linear(x)
|
| 113 |
+
|
| 114 |
+
return x_32
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
class AcousticDecoder(nn.Module):
|
| 118 |
+
""" Pitch, Duration, Energy Predictor """
|
| 119 |
+
|
| 120 |
+
def __init__(self,
|
| 121 |
+
pitch_stats=None,
|
| 122 |
+
energy_stats=None,
|
| 123 |
+
duration_stats=None,
|
| 124 |
+
duration=False):
|
| 125 |
+
super().__init__()
|
| 126 |
+
|
| 127 |
+
dim=32
|
| 128 |
+
self.conv1 = nn.Conv1d(dim, dim, kernel_size=3, padding=1)
|
| 129 |
+
self.dyt1 = DynamicTanh(dim)
|
| 130 |
+
self.conv2 = nn.Conv1d(dim, dim, kernel_size=3, padding=1)
|
| 131 |
+
self.dyt2 = DynamicTanh(dim)
|
| 132 |
+
self.linear = nn.Linear(dim, 1)
|
| 133 |
+
self.duration = duration
|
| 134 |
+
|
| 135 |
+
if pitch_stats is not None:
|
| 136 |
+
pitch_min, pitch_max = pitch_stats
|
| 137 |
+
self.pitch_bins = nn.Parameter(torch.linspace(pitch_min, pitch_max, dim - 1),\
|
| 138 |
+
requires_grad=False,)
|
| 139 |
+
self.pitch_embedding = nn.Embedding(dim, dim)
|
| 140 |
+
else:
|
| 141 |
+
self.pitch_bins = None
|
| 142 |
+
self.pitch_embedding = None
|
| 143 |
+
|
| 144 |
+
if energy_stats is not None:
|
| 145 |
+
energy_min, energy_max = energy_stats
|
| 146 |
+
self.energy_bins = nn.Parameter(torch.linspace(energy_min, energy_max, dim - 1), \
|
| 147 |
+
requires_grad=False,)
|
| 148 |
+
self.energy_embedding = nn.Embedding(dim, dim)
|
| 149 |
+
else:
|
| 150 |
+
self.energy_bins = None
|
| 151 |
+
self.energy_embedding = None
|
| 152 |
+
|
| 153 |
+
if duration_stats is not None:
|
| 154 |
+
duration_min, duration_max = duration_stats
|
| 155 |
+
self.duration_bins = nn.Parameter(torch.linspace(duration_min, duration_max, dim - 1), \
|
| 156 |
+
requires_grad=False,)
|
| 157 |
+
self.duration_embedding = nn.Embedding(dim, dim)
|
| 158 |
+
else:
|
| 159 |
+
self.duration_bins = None
|
| 160 |
+
self.duration_embedding = None
|
| 161 |
+
|
| 162 |
+
|
| 163 |
+
def get_pitch_embedding(self, pred, target, mask, control=1.):
|
| 164 |
+
if target is not None:
|
| 165 |
+
embedding = self.pitch_embedding(torch.bucketize(target, self.pitch_bins))
|
| 166 |
+
else:
|
| 167 |
+
#pred = pred * control
|
| 168 |
+
embedding = self.pitch_embedding(torch.bucketize(pred, self.pitch_bins))
|
| 169 |
+
return embedding
|
| 170 |
+
|
| 171 |
+
def get_energy_embedding(self, pred, target, mask, control=1.):
|
| 172 |
+
if target is not None:
|
| 173 |
+
embedding = self.energy_embedding(torch.bucketize(target, self.energy_bins))
|
| 174 |
+
else:
|
| 175 |
+
#pred = pred * control
|
| 176 |
+
embedding = self.energy_embedding(torch.bucketize(pred, self.energy_bins))
|
| 177 |
+
return embedding
|
| 178 |
+
|
| 179 |
+
def get_duration_embedding(self, pred, target, mask, control=1.):
|
| 180 |
+
if target is not None:
|
| 181 |
+
embedding = self.duration_embedding(torch.bucketize(target.float(), self.duration_bins))
|
| 182 |
+
else:
|
| 183 |
+
embedding = self.duration_embedding(torch.bucketize(pred.float(), self.duration_bins))
|
| 184 |
+
return embedding
|
| 185 |
+
|
| 186 |
+
def get_embedding(self, pred, target, mask, control=1.):
|
| 187 |
+
if self.pitch_embedding is not None:
|
| 188 |
+
return self.get_pitch_embedding(pred, target, mask, control)
|
| 189 |
+
elif self.energy_embedding is not None:
|
| 190 |
+
return self.get_energy_embedding(pred, target, mask, control)
|
| 191 |
+
elif self.duration_embedding is not None:
|
| 192 |
+
return self.get_duration_embedding(pred, target, mask, control)
|
| 193 |
+
return None
|
| 194 |
+
|
| 195 |
+
def forward(self, features):
|
| 196 |
+
|
| 197 |
+
y = features.permute(0, 2, 1)
|
| 198 |
+
y = self.conv1(y)
|
| 199 |
+
y = y.permute(0, 2, 1)
|
| 200 |
+
y = self.dyt1(y)
|
| 201 |
+
y = y.permute(0, 2, 1)
|
| 202 |
+
y = self.conv2(y)
|
| 203 |
+
y = y.permute(0, 2, 1)
|
| 204 |
+
y = self.dyt2(y)
|
| 205 |
+
y = self.linear(y)
|
| 206 |
+
if self.duration:
|
| 207 |
+
y = nn.ReLU()(y)+1
|
| 208 |
+
return y
|
| 209 |
+
|
| 210 |
+
|
| 211 |
+
|
| 212 |
+
class FeatureUpsampler(nn.Module):
|
| 213 |
+
""" Upsample fused features using target or predicted duration"""
|
| 214 |
+
|
| 215 |
+
def __init__(self):
|
| 216 |
+
super().__init__()
|
| 217 |
+
|
| 218 |
+
def forward(self, fused_features, fused_masks, duration, max_mel_len=None):
|
| 219 |
+
mel_len = list()
|
| 220 |
+
features = list()
|
| 221 |
+
masks = list()
|
| 222 |
+
|
| 223 |
+
for feature, mask, repetition in zip(fused_features, fused_masks, duration):
|
| 224 |
+
repetition = repetition.squeeze().int()
|
| 225 |
+
feature = feature.repeat_interleave(repetition, dim=0)
|
| 226 |
+
mask = mask.repeat_interleave(repetition, dim=0)
|
| 227 |
+
mel_len.append(feature.shape[0])
|
| 228 |
+
if max_mel_len is not None:
|
| 229 |
+
feature = F.pad(feature, (0, 0, 0, max_mel_len -
|
| 230 |
+
feature.shape[0]), "constant", 0.0)
|
| 231 |
+
mask = F.pad(mask, (0, 0, 0, max_mel_len -
|
| 232 |
+
mask.shape[0]), "constant", True)
|
| 233 |
+
features.append(feature)
|
| 234 |
+
masks.append(mask)
|
| 235 |
+
|
| 236 |
+
if max_mel_len is None:
|
| 237 |
+
max_mel_len = max(mel_len)
|
| 238 |
+
features = [F.pad(feature, (0, 0, 0, max_mel_len - feature.shape[0]),
|
| 239 |
+
"constant", 0.0) for feature in features]
|
| 240 |
+
masks = [F.pad(mask, (0, 0, 0, max_mel_len - mask.shape[0]),
|
| 241 |
+
"constant", True) for mask in masks]
|
| 242 |
+
|
| 243 |
+
features = torch.stack(features)
|
| 244 |
+
masks = torch.stack(masks)
|
| 245 |
+
len_pred = torch.IntTensor(mel_len).to(features.device)
|
| 246 |
+
#len_pred = torch.LongTensor(mel_len).to(features.device)
|
| 247 |
+
|
| 248 |
+
return features, masks, len_pred
|
| 249 |
+
|
| 250 |
+
|
| 251 |
+
|
| 252 |
+
class MelDecoder(nn.Module):
|
| 253 |
+
""" Mel Spectrogram Decoder """
|
| 254 |
+
|
| 255 |
+
def __init__(self):
|
| 256 |
+
super().__init__()
|
| 257 |
+
|
| 258 |
+
dim_mel=80
|
| 259 |
+
|
| 260 |
+
self.proj = nn.Conv1d(dim_mel, dim_mel, kernel_size=9, padding=4, dilation=1, groups=dim_mel)
|
| 261 |
+
|
| 262 |
+
self.block1_dyt1 = DynamicTanh(dim_mel)
|
| 263 |
+
self.block1_conv1_dw = nn.Conv1d(dim_mel, dim_mel, kernel_size=3, padding=1, dilation=1, groups=dim_mel)
|
| 264 |
+
self.block1_conv1_pw = nn.Conv1d(dim_mel, dim_mel, kernel_size=1)
|
| 265 |
+
|
| 266 |
+
self.block1_dyt2 = DynamicTanh(dim_mel)
|
| 267 |
+
self.block1_conv2_dw = nn.Conv1d(dim_mel, dim_mel, kernel_size=3, padding=1, dilation=1, groups=dim_mel)
|
| 268 |
+
self.block1_conv2_pw = nn.Conv1d(dim_mel, dim_mel, kernel_size=1)
|
| 269 |
+
|
| 270 |
+
self.block2_dyt1 = DynamicTanh(dim_mel)
|
| 271 |
+
self.block2_conv1_dw = nn.Conv1d(dim_mel, dim_mel, kernel_size=3, padding=3, dilation=3, groups=dim_mel)
|
| 272 |
+
self.block2_conv1_pw = nn.Conv1d(dim_mel, dim_mel, kernel_size=1)
|
| 273 |
+
self.block2_dyt2 = DynamicTanh(dim_mel)
|
| 274 |
+
self.block2_conv2_dw = nn.Conv1d(dim_mel, dim_mel, kernel_size=3, padding=1, dilation=1, groups=dim_mel)
|
| 275 |
+
self.block2_conv2_pw = nn.Conv1d(dim_mel, dim_mel, kernel_size=1)
|
| 276 |
+
|
| 277 |
+
self.block3_dyt1 = DynamicTanh(dim_mel)
|
| 278 |
+
self.block3_conv1_dw = nn.Conv1d(dim_mel, dim_mel, kernel_size=3, padding=5, dilation=5, groups=dim_mel)
|
| 279 |
+
self.block3_conv1_pw = nn.Conv1d(dim_mel, dim_mel, kernel_size=1)
|
| 280 |
+
self.block3_dyt2 = DynamicTanh(dim_mel)
|
| 281 |
+
self.block3_conv2_dw = nn.Conv1d(dim_mel, dim_mel, kernel_size=3, padding=1, dilation=1, groups=dim_mel)
|
| 282 |
+
self.block3_conv2_pw = nn.Conv1d(dim_mel, dim_mel, kernel_size=1)
|
| 283 |
+
|
| 284 |
+
self.mel_linear_up = nn.Linear(dim_mel, 4*dim_mel)
|
| 285 |
+
self.mel_dyt = DynamicTanh(4*dim_mel)
|
| 286 |
+
self.mel_linear_down = nn.Linear(4*dim_mel, dim_mel)
|
| 287 |
+
|
| 288 |
+
|
| 289 |
+
def forward(self, features):
|
| 290 |
+
x = features
|
| 291 |
+
x = x.permute(0, 2, 1)
|
| 292 |
+
x = self.proj(x)
|
| 293 |
+
x = x.permute(0, 2, 1)
|
| 294 |
+
|
| 295 |
+
skip = x
|
| 296 |
+
x = self.block1_dyt1(skip)
|
| 297 |
+
x = x.permute(0, 2, 1)
|
| 298 |
+
x = self.block1_conv1_dw(x)
|
| 299 |
+
x = self.block1_conv1_pw(x)
|
| 300 |
+
x = x.permute(0, 2, 1)
|
| 301 |
+
x = self.block1_dyt2(x)
|
| 302 |
+
x = x.permute(0, 2, 1)
|
| 303 |
+
x = self.block1_conv2_dw(x)
|
| 304 |
+
x = self.block1_conv2_pw(x)
|
| 305 |
+
x = x.permute(0, 2, 1)
|
| 306 |
+
|
| 307 |
+
skip = x + skip
|
| 308 |
+
x = self.block2_dyt1(skip)
|
| 309 |
+
x = x.permute(0, 2, 1)
|
| 310 |
+
x = self.block2_conv1_dw(x)
|
| 311 |
+
x = self.block2_conv1_pw(x)
|
| 312 |
+
x = x.permute(0, 2, 1)
|
| 313 |
+
x = self.block2_dyt2(x)
|
| 314 |
+
x = x.permute(0, 2, 1)
|
| 315 |
+
x = self.block2_conv2_dw(x)
|
| 316 |
+
x = self.block2_conv2_pw(x)
|
| 317 |
+
x = x.permute(0, 2, 1)
|
| 318 |
+
|
| 319 |
+
skip = x + skip
|
| 320 |
+
x = self.block3_dyt1(skip)
|
| 321 |
+
x = x.permute(0, 2, 1)
|
| 322 |
+
x = self.block3_conv1_dw(x)
|
| 323 |
+
x = self.block3_conv1_pw(x)
|
| 324 |
+
x = x.permute(0, 2, 1)
|
| 325 |
+
x = self.block3_dyt2(x)
|
| 326 |
+
x = x.permute(0, 2, 1)
|
| 327 |
+
x = self.block3_conv2_dw(x)
|
| 328 |
+
x = self.block3_conv2_pw(x)
|
| 329 |
+
x = x.permute(0, 2, 1)
|
| 330 |
+
|
| 331 |
+
mel = self.mel_linear_up(x + skip)
|
| 332 |
+
mel = self.mel_dyt(mel)
|
| 333 |
+
mel = self.mel_linear_down(mel)
|
| 334 |
+
|
| 335 |
+
return mel
|
| 336 |
+
|
| 337 |
+
|
| 338 |
+
class PhonemeEncoder(nn.Module):
|
| 339 |
+
""" Encodes phonemes to acoustic features """
|
| 340 |
+
|
| 341 |
+
def __init__(self, pitch_stats=None, energy_stats=None):
|
| 342 |
+
super().__init__()
|
| 343 |
+
|
| 344 |
+
self.encoder = Encoder()
|
| 345 |
+
|
| 346 |
+
|
| 347 |
+
self.feature_upsampler = FeatureUpsampler()
|
| 348 |
+
self.pitch_decoder = AcousticDecoder(pitch_stats=pitch_stats)
|
| 349 |
+
self.energy_decoder = AcousticDecoder(energy_stats=energy_stats)
|
| 350 |
+
self.duration_decoder = AcousticDecoder(duration=True, duration_stats=(2, 34))
|
| 351 |
+
|
| 352 |
+
self.fusion_linear = nn.Linear(32*4, 80)
|
| 353 |
+
|
| 354 |
+
|
| 355 |
+
def forward(self, x, train=False):
|
| 356 |
+
phoneme = x["phoneme"]
|
| 357 |
+
phoneme_mask = x["phoneme_mask"] if phoneme.shape[0] > 1 else None
|
| 358 |
+
|
| 359 |
+
pitch_target = x["pitch"] if train else None
|
| 360 |
+
energy_target = x["energy"] if train else None
|
| 361 |
+
duration_target = x["duration"] if train else None
|
| 362 |
+
mel_len = x["mel_len"] if train else None
|
| 363 |
+
max_mel_len = torch.max(mel_len).item() if train else None
|
| 364 |
+
|
| 365 |
+
features = self.encoder(phoneme)
|
| 366 |
+
|
| 367 |
+
mask = None
|
| 368 |
+
if phoneme_mask is not None:
|
| 369 |
+
mask = repeat(phoneme_mask, 'b n -> b n a', a=features.shape[-1])
|
| 370 |
+
features = features.masked_fill(mask, 0)
|
| 371 |
+
|
| 372 |
+
pitch_pred = self.pitch_decoder(features)
|
| 373 |
+
pitch_features = self.pitch_decoder.get_embedding(pitch_pred, pitch_target, mask)
|
| 374 |
+
pitch_features = pitch_features.squeeze()
|
| 375 |
+
if mask is not None:
|
| 376 |
+
pitch_features = pitch_features.masked_fill(mask, 0)
|
| 377 |
+
elif pitch_features.dim() != 3:
|
| 378 |
+
pitch_features = pitch_features.unsqueeze(0)
|
| 379 |
+
|
| 380 |
+
energy_pred = self.energy_decoder(features)
|
| 381 |
+
energy_features = self.energy_decoder.get_embedding(energy_pred, energy_target, mask)
|
| 382 |
+
energy_features = energy_features.squeeze()
|
| 383 |
+
|
| 384 |
+
if mask is not None:
|
| 385 |
+
energy_features = energy_features.masked_fill(mask, 0)
|
| 386 |
+
elif energy_features.dim() != 3:
|
| 387 |
+
energy_features = energy_features.unsqueeze(0)
|
| 388 |
+
|
| 389 |
+
duration_pred = self.duration_decoder(features)
|
| 390 |
+
# Persian boundary tokens may have zero acoustic duration; speech phones retain >=1.
|
| 391 |
+
if hasattr(self, "boundary_token_ids"):
|
| 392 |
+
boundary = torch.zeros_like(phoneme, dtype=torch.bool)
|
| 393 |
+
for token_id in self.boundary_token_ids:
|
| 394 |
+
boundary |= phoneme == token_id
|
| 395 |
+
duration_pred = torch.where(boundary.unsqueeze(-1), (duration_pred - 1.0).clamp(min=0), duration_pred)
|
| 396 |
+
duration_features = self.duration_decoder.get_embedding(duration_pred, duration_target, mask)
|
| 397 |
+
duration_features = duration_features.squeeze()
|
| 398 |
+
if mask is not None:
|
| 399 |
+
duration_features = duration_features.masked_fill(mask, 0)
|
| 400 |
+
elif duration_features.dim() != 3:
|
| 401 |
+
duration_features = duration_features.unsqueeze(0)
|
| 402 |
+
|
| 403 |
+
fused_features = torch.cat([features, pitch_features, \
|
| 404 |
+
energy_features, duration_features], dim=-1)
|
| 405 |
+
|
| 406 |
+
fused_features = self.fusion_linear(fused_features)
|
| 407 |
+
|
| 408 |
+
if phoneme_mask is not None:
|
| 409 |
+
fused_masks = repeat(phoneme_mask, 'b n -> b n a', a=fused_features.shape[-1])
|
| 410 |
+
fused_features = fused_features.masked_fill(fused_masks, 0)
|
| 411 |
+
else:
|
| 412 |
+
fused_masks = torch.zeros_like(fused_features).bool()
|
| 413 |
+
|
| 414 |
+
if duration_target is None:
|
| 415 |
+
duration_target = torch.round(duration_pred).squeeze()
|
| 416 |
+
if phoneme_mask is not None:
|
| 417 |
+
duration_target = duration_target.masked_fill(phoneme_mask, 0).clamp(min=0)
|
| 418 |
+
else:
|
| 419 |
+
duration_target = duration_target.unsqueeze(0)
|
| 420 |
+
|
| 421 |
+
features, masks, mel_len_pred = self.feature_upsampler(fused_features,
|
| 422 |
+
fused_masks,
|
| 423 |
+
duration=duration_target,
|
| 424 |
+
max_mel_len=max_mel_len,)
|
| 425 |
+
|
| 426 |
+
if mask is None:
|
| 427 |
+
masks = None
|
| 428 |
+
|
| 429 |
+
y = {"pitch": pitch_pred,
|
| 430 |
+
"energy": energy_pred,
|
| 431 |
+
"duration": duration_pred,
|
| 432 |
+
"mel_len": mel_len_pred,
|
| 433 |
+
"features": features,
|
| 434 |
+
"masks": masks, }
|
| 435 |
+
|
| 436 |
+
return y
|
| 437 |
+
|
| 438 |
+
|
| 439 |
+
class Phoneme2Mel(nn.Module):
|
| 440 |
+
""" From Phoneme Sequence to Mel Spectrogram """
|
| 441 |
+
|
| 442 |
+
def __init__(self,
|
| 443 |
+
encoder,
|
| 444 |
+
decoder):
|
| 445 |
+
super().__init__()
|
| 446 |
+
|
| 447 |
+
self.encoder = encoder
|
| 448 |
+
self.decoder = decoder
|
| 449 |
+
|
| 450 |
+
def forward(self, x, train=False):
|
| 451 |
+
# Dirty trick to enable ONNX compilation.
|
| 452 |
+
# Else, the torch.to_onnx complains about missing input in the forward method.
|
| 453 |
+
if isinstance(x, list):
|
| 454 |
+
x = x[0]
|
| 455 |
+
|
| 456 |
+
pred = self.encoder(x, train=train)
|
| 457 |
+
mel = self.decoder(pred["features"])
|
| 458 |
+
|
| 459 |
+
mask = pred["masks"]
|
| 460 |
+
if mask is not None and mel.size(0) > 1:
|
| 461 |
+
mask = mask[:, :, :1].expand(-1, -1, mel.shape[-1])
|
| 462 |
+
mel = mel.masked_fill(mask, 0)
|
| 463 |
+
|
| 464 |
+
pred["mel"] = mel
|
| 465 |
+
|
| 466 |
+
if train:
|
| 467 |
+
return pred
|
| 468 |
+
|
| 469 |
+
return mel, pred["mel_len"], pred["duration"]
|
gooya_tts/normalize.py
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Deterministic Persian text normalization before G2P.
|
| 2 |
+
|
| 3 |
+
The G2P model should predict pronunciation, not perform arithmetic. This module
|
| 4 |
+
expands the number forms that previously caused structural decoder failures while
|
| 5 |
+
leaving punctuation available to the pacing layer.
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
from __future__ import annotations
|
| 9 |
+
|
| 10 |
+
import re
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
_DIGIT_TRANSLATION = str.maketrans("۰۱۲۳۴۵۶۷۸۹٠١٢٣٤٥٦٧٨٩", "01234567890123456789")
|
| 14 |
+
_ONES = ("صفر", "یک", "دو", "سه", "چهار", "پنج", "شش", "هفت", "هشت", "نه")
|
| 15 |
+
_TEENS = {
|
| 16 |
+
10: "ده", 11: "یازده", 12: "دوازده", 13: "سیزده", 14: "چهارده",
|
| 17 |
+
15: "پانزده", 16: "شانزده", 17: "هفده", 18: "هجده", 19: "نوزده",
|
| 18 |
+
}
|
| 19 |
+
_TENS = {20: "بیست", 30: "سی", 40: "چهل", 50: "پنجاه", 60: "شصت", 70: "هفتاد", 80: "هشتاد", 90: "نود"}
|
| 20 |
+
_HUNDREDS = {100: "صد", 200: "دویست", 300: "سیصد", 400: "چهارصد", 500: "پانصد", 600: "ششصد", 700: "هفتصد", 800: "هشتصد", 900: "نهصد"}
|
| 21 |
+
_SCALES = ((10**12, "تریلیون"), (10**9, "میلیارد"), (10**6, "میلیون"), (10**3, "هزار"))
|
| 22 |
+
_NUMBER = re.compile(
|
| 23 |
+
r"(?<![\w])(?P<sign>[+\-−]?)(?P<int>[0-9]+(?:[٬,][0-9]{3})*)(?:(?P<decimal>[٫.])(?P<fraction>[0-9]+))?(?P<percent>[٪%])?(?![\w])"
|
| 24 |
+
)
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def integer_to_persian(number: int) -> str:
|
| 28 |
+
if number < 0:
|
| 29 |
+
return "منفی " + integer_to_persian(-number)
|
| 30 |
+
if number < 10:
|
| 31 |
+
return _ONES[number]
|
| 32 |
+
if number < 20:
|
| 33 |
+
return _TEENS[number]
|
| 34 |
+
if number < 100:
|
| 35 |
+
tens, rest = divmod(number, 10)
|
| 36 |
+
parts = [_TENS[tens * 10]]
|
| 37 |
+
if rest:
|
| 38 |
+
parts.append(_ONES[rest])
|
| 39 |
+
return " و ".join(parts)
|
| 40 |
+
if number < 1000:
|
| 41 |
+
hundreds, rest = divmod(number, 100)
|
| 42 |
+
parts = [_HUNDREDS[hundreds * 100]]
|
| 43 |
+
if rest:
|
| 44 |
+
parts.append(integer_to_persian(rest))
|
| 45 |
+
return " و ".join(parts)
|
| 46 |
+
for scale, label in _SCALES:
|
| 47 |
+
if number >= scale:
|
| 48 |
+
count, rest = divmod(number, scale)
|
| 49 |
+
parts = [f"{integer_to_persian(count)} {label}"]
|
| 50 |
+
if rest:
|
| 51 |
+
parts.append(integer_to_persian(rest))
|
| 52 |
+
return " و ".join(parts)
|
| 53 |
+
raise ValueError(f"number is outside the supported range: {number}")
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
def _expand_number(match: re.Match[str]) -> str:
|
| 57 |
+
integer_digits = match.group("int").replace("٬", "").replace(",", "")
|
| 58 |
+
parts: list[str] = []
|
| 59 |
+
sign = match.group("sign")
|
| 60 |
+
if sign in {"-", "−"}:
|
| 61 |
+
parts.append("منفی")
|
| 62 |
+
elif sign == "+":
|
| 63 |
+
parts.append("مثبت")
|
| 64 |
+
parts.append(integer_to_persian(int(integer_digits)))
|
| 65 |
+
fraction = match.group("fraction")
|
| 66 |
+
if fraction is not None:
|
| 67 |
+
parts.append("ممیز")
|
| 68 |
+
parts.append(" ".join(_ONES[int(digit)] for digit in fraction))
|
| 69 |
+
if match.group("percent"):
|
| 70 |
+
parts.append("درصد")
|
| 71 |
+
return " ".join(parts)
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
def normalize_persian_for_g2p(text: str) -> str:
|
| 75 |
+
"""Expand Persian/Arabic/ASCII numerals and retain authored punctuation."""
|
| 76 |
+
ascii_digits = str(text).translate(_DIGIT_TRANSLATION)
|
| 77 |
+
return _NUMBER.sub(_expand_number, ascii_digits)
|
gooya_tts/runtime.py
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Self-contained inference for Gooya v2 experimental releases."""
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
import json,re,warnings
|
| 4 |
+
import numpy as np
|
| 5 |
+
import torch
|
| 6 |
+
from torch import nn
|
| 7 |
+
from torch.nn import functional as F
|
| 8 |
+
from torch.nn.utils.rnn import pack_padded_sequence,pad_packed_sequence
|
| 9 |
+
from torch.nn.utils import weight_norm
|
| 10 |
+
from safetensors.torch import load_file
|
| 11 |
+
from transformers import AutoTokenizer,AutoModelForSeq2SeqLM
|
| 12 |
+
from .networks import PhonemeEncoder,MelDecoder,Phoneme2Mel
|
| 13 |
+
from .hifigan import Generator
|
| 14 |
+
from .normalize import normalize_persian_for_g2p
|
| 15 |
+
from .words import surface_words
|
| 16 |
+
|
| 17 |
+
class ContextEncoder(nn.Module):
|
| 18 |
+
def __init__(self,local):
|
| 19 |
+
super().__init__(); self.local=local; self.context=nn.GRU(80,128,batch_first=True,bidirectional=True); self.project=nn.Linear(256,32); self.dropout=nn.Dropout(.1)
|
| 20 |
+
def forward(self,phones):
|
| 21 |
+
x=self.local.embed(phones); lengths=(phones!=0).sum(-1).cpu()
|
| 22 |
+
packed=pack_padded_sequence(x,lengths,batch_first=True,enforce_sorted=False)
|
| 23 |
+
y,_=self.context(packed); y,_=pad_packed_sequence(y,batch_first=True,total_length=phones.shape[1])
|
| 24 |
+
return self.local(phones)+self.project(self.dropout(y))
|
| 25 |
+
|
| 26 |
+
class SmoothDuration(nn.Module):
|
| 27 |
+
def __init__(self,original):
|
| 28 |
+
super().__init__(); self.original=original; self.original.duration=False
|
| 29 |
+
def forward(self,x): return F.softplus(self.original(x))+1
|
| 30 |
+
def get_embedding(self,*args,**kwargs): return self.original.get_embedding(*args,**kwargs)
|
| 31 |
+
|
| 32 |
+
class AttrDict(dict):
|
| 33 |
+
__getattr__=dict.__getitem__
|
| 34 |
+
|
| 35 |
+
class GooyaTTS:
|
| 36 |
+
"""Loads all model weights locally. CPU is the default; CUDA is optional."""
|
| 37 |
+
def __init__(self,model_dir,device='cpu',num_threads=4):
|
| 38 |
+
self.root=Path(model_dir); self.device=torch.device(device)
|
| 39 |
+
if num_threads: torch.set_num_threads(num_threads)
|
| 40 |
+
self.config=json.loads((self.root/'gooya_config.json').read_text()); self.sample_rate=self.config['sample_rate']; self.ids=self.config['vocabulary']
|
| 41 |
+
self.tokenizer=AutoTokenizer.from_pretrained(self.root/'frontend',local_files_only=True)
|
| 42 |
+
self.g2p=AutoModelForSeq2SeqLM.from_pretrained(self.root/'frontend',local_files_only=True).to(self.device).eval()
|
| 43 |
+
stats=self.config['stats']; encoder=PhonemeEncoder(pitch_stats=stats['pitch'][:2],energy_stats=stats['energy'][:2]); decoder=MelDecoder()
|
| 44 |
+
encoder.encoder.embed=nn.Embedding(len(self.ids),80,padding_idx=0)
|
| 45 |
+
encoder.boundary_token_ids=[i for s,i in self.ids.items() if s.startswith('<')]
|
| 46 |
+
encoder.encoder=ContextEncoder(encoder.encoder); encoder.duration_decoder=SmoothDuration(encoder.duration_decoder)
|
| 47 |
+
decoder.mel_linear_down=nn.Linear(320,100); self.acoustic=Phoneme2Mel(encoder,decoder)
|
| 48 |
+
self.acoustic.load_state_dict(load_file(str(self.root/'acoustic.safetensors')),strict=True); self.acoustic.to(self.device).eval()
|
| 49 |
+
self.vocoder=Generator(AttrDict(self.config['vocoder_config'])); self.vocoder.conv_pre=weight_norm(nn.Conv1d(100,128,7,1,padding=3))
|
| 50 |
+
self.vocoder.load_state_dict(load_file(str(self.root/'vocoder.safetensors')),strict=True); self.vocoder.to(self.device).eval()
|
| 51 |
+
self.overlay={}
|
| 52 |
+
if self.config['frontend']['overlay']:
|
| 53 |
+
data=json.loads((self.root/'frontend/overlay.json').read_text()); self.overlay={(r['surface'],r['raw']):r['target'] for r in data['rules']}
|
| 54 |
+
count=sum(p.numel() for m in [self.g2p,self.acoustic,self.vocoder] for p in m.parameters())
|
| 55 |
+
if count!=self.config['parameters']['total']: raise ValueError(f'Parameter count mismatch: {count}')
|
| 56 |
+
@classmethod
|
| 57 |
+
def from_pretrained(cls,repo_id,revision=None,**kwargs):
|
| 58 |
+
from huggingface_hub import snapshot_download
|
| 59 |
+
return cls(snapshot_download(repo_id,revision=revision),**kwargs)
|
| 60 |
+
@torch.inference_mode()
|
| 61 |
+
def synthesize(self,text,return_details=False):
|
| 62 |
+
if not isinstance(text,str) or not text.strip(): raise ValueError('Text must be a nonempty string.')
|
| 63 |
+
chunks=re.findall(r'[^،,؟?\.\n]+[،,؟?\.]?',text); waves=[]; records=[]
|
| 64 |
+
for chunk in chunks:
|
| 65 |
+
chunk=chunk.strip()
|
| 66 |
+
if not chunk: continue
|
| 67 |
+
normalized=normalize_persian_for_g2p(chunk)
|
| 68 |
+
x=self.tokenizer(normalized,return_tensors='pt',add_special_tokens=False).to(self.device)
|
| 69 |
+
if x['input_ids'].shape[1]>1024: raise ValueError('Clause exceeds 1024 input tokens; use shorter sentences or punctuation.')
|
| 70 |
+
output=self.g2p.generate(**x,max_new_tokens=self.config['frontend']['max_new_tokens'],num_beams=self.config['frontend']['num_beams'])
|
| 71 |
+
if self.tokenizer.eos_token_id not in output[0,1:].tolist(): raise RuntimeError('G2P did not terminate. Split this clause into shorter phrases; no incomplete audio was returned.')
|
| 72 |
+
phones=self.tokenizer.decode(output[0],skip_special_tokens=True).strip().replace('?','Q')
|
| 73 |
+
words=surface_words(normalized); pw=phones.split(); matched=len(words)==len(pw)
|
| 74 |
+
if self.overlay and matched: phones=' '.join(self.overlay.get((a,b),b) for a,b in zip(words,pw))
|
| 75 |
+
if not matched: warnings.warn('G2P word count differs from input; inspect pronunciation in returned details.',RuntimeWarning)
|
| 76 |
+
if not phones: raise RuntimeError('G2P returned an empty pronunciation.')
|
| 77 |
+
tokens=['<sil>']+['<wb>' if c==' ' else c for c in phones]+['<comma>' if chunk[-1] in '،,' else '<stop>']
|
| 78 |
+
unknown=set(tokens)-set(self.ids)
|
| 79 |
+
if unknown: raise ValueError(f'Unsupported G2P symbols: {sorted(unknown)}')
|
| 80 |
+
encoded=torch.tensor([[self.ids[t] for t in tokens]],device=self.device)
|
| 81 |
+
pred=self.acoustic.encoder({'phoneme':encoded},train=False); mel=self.acoustic.decoder(pred['features'])
|
| 82 |
+
if mel.shape[1]>24000//256*120: raise RuntimeError('Predicted clause duration exceeds 120 seconds.')
|
| 83 |
+
wave=self.vocoder(F.pad(mel.transpose(1,2),(4,4),mode='replicate'))[:,:,1024:-1024].squeeze().cpu().numpy()
|
| 84 |
+
if not np.isfinite(wave).all(): raise RuntimeError('Nonfinite audio output.')
|
| 85 |
+
waves.append(wave); gap=self.config['comma_gap_seconds'] if chunk[-1] in '،,' else self.config['sentence_gap_seconds']; waves.append(np.zeros(round(gap*self.sample_rate),dtype=np.float32))
|
| 86 |
+
records.append({'text':chunk,'normalized':normalized,'phonemes':phones,'word_count_matches':matched,'duration_seconds':len(wave)/self.sample_rate})
|
| 87 |
+
if not waves: raise ValueError('No speakable text found.')
|
| 88 |
+
result=np.concatenate(waves[:-1]); details={'text':text,'model':self.config['name'],'parameters':self.config['parameters'],'sample_rate':self.sample_rate,'segments':records,'duration_seconds':len(result)/self.sample_rate}
|
| 89 |
+
return (result,details) if return_details else result
|
gooya_tts/words.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import unicodedata
|
| 2 |
+
|
| 3 |
+
def surface_words(text: str) -> list[str]:
|
| 4 |
+
"""Dependency-free equivalent of Gooya's ZWNJ-preserving word scan."""
|
| 5 |
+
result: list[str] = []
|
| 6 |
+
cursor = 0
|
| 7 |
+
while cursor < len(text):
|
| 8 |
+
if text[cursor].isspace():
|
| 9 |
+
cursor += 1
|
| 10 |
+
continue
|
| 11 |
+
is_word = text[cursor] == "\u200c" or unicodedata.category(text[cursor])[0] in {"L", "M", "N"}
|
| 12 |
+
if not is_word:
|
| 13 |
+
cursor += 1
|
| 14 |
+
continue
|
| 15 |
+
start = cursor
|
| 16 |
+
cursor += 1
|
| 17 |
+
while cursor < len(text) and (text[cursor] == "\u200c" or unicodedata.category(text[cursor])[0] in {"L", "M", "N"}):
|
| 18 |
+
cursor += 1
|
| 19 |
+
result.append(text[start:cursor])
|
| 20 |
+
return result
|
| 21 |
+
|
infer.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pathlib import Path
|
| 2 |
+
import argparse,json
|
| 3 |
+
import soundfile as sf
|
| 4 |
+
from gooya_tts import GooyaTTS
|
| 5 |
+
|
| 6 |
+
def main():
|
| 7 |
+
parser=argparse.ArgumentParser(description='Standalone Persian text-to-speech; all weights loaded from this package.')
|
| 8 |
+
source=parser.add_mutually_exclusive_group(required=True);source.add_argument('--text');source.add_argument('--text-file',type=Path)
|
| 9 |
+
parser.add_argument('--model-dir',type=Path,default=Path(__file__).resolve().parent);parser.add_argument('--output',type=Path,default=Path('output.wav'));parser.add_argument('--device',default='cpu');parser.add_argument('--threads',type=int,default=4)
|
| 10 |
+
args=parser.parse_args();text=args.text if args.text is not None else args.text_file.read_text(encoding='utf-8')
|
| 11 |
+
model=GooyaTTS(args.model_dir,device=args.device,num_threads=args.threads);wave,details=model.synthesize(text,return_details=True)
|
| 12 |
+
args.output.parent.mkdir(parents=True,exist_ok=True);sf.write(args.output,wave,model.sample_rate,subtype='FLOAT');args.output.with_suffix('.json').write_text(json.dumps(details,ensure_ascii=False,indent=2),encoding='utf-8');print(f'Wrote {args.output} ({details["duration_seconds"]:.2f} seconds, {model.sample_rate} Hz)')
|
| 13 |
+
if __name__=='__main__':main()
|
licenses/HiFi-GAN-MIT.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2020 Jungil Kong
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
licenses/Negara-Apache-2.0.txt
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Apache License
|
| 3 |
+
Version 2.0, January 2004
|
| 4 |
+
http://www.apache.org/licenses/
|
| 5 |
+
|
| 6 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 7 |
+
|
| 8 |
+
1. Definitions.
|
| 9 |
+
|
| 10 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 11 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 12 |
+
|
| 13 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 14 |
+
the copyright owner that is granting the License.
|
| 15 |
+
|
| 16 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 17 |
+
other entities that control, are controlled by, or are under common
|
| 18 |
+
control with that entity. For the purposes of this definition,
|
| 19 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 20 |
+
direction or management of such entity, whether by contract or
|
| 21 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 22 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 23 |
+
|
| 24 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 25 |
+
exercising permissions granted by this License.
|
| 26 |
+
|
| 27 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 28 |
+
including but not limited to software source code, documentation
|
| 29 |
+
source, and configuration files.
|
| 30 |
+
|
| 31 |
+
"Object" form shall mean any form resulting from mechanical
|
| 32 |
+
transformation or translation of a Source form, including but
|
| 33 |
+
not limited to compiled object code, generated documentation,
|
| 34 |
+
and conversions to other media types.
|
| 35 |
+
|
| 36 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 37 |
+
Object form, made available under the License, as indicated by a
|
| 38 |
+
copyright notice that is included in or attached to the work
|
| 39 |
+
(an example is provided in the Appendix below).
|
| 40 |
+
|
| 41 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 42 |
+
form, that is based on (or derived from) the Work and for which the
|
| 43 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 44 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 45 |
+
of this License, Derivative Works shall not include works that remain
|
| 46 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 47 |
+
the Work and Derivative Works thereof.
|
| 48 |
+
|
| 49 |
+
"Contribution" shall mean any work of authorship, including
|
| 50 |
+
the original version of the Work and any modifications or additions
|
| 51 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 52 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 53 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 54 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 55 |
+
means any form of electronic, verbal, or written communication sent
|
| 56 |
+
to the Licensor or its representatives, including but not limited to
|
| 57 |
+
communication on electronic mailing lists, source code control systems,
|
| 58 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 59 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 60 |
+
excluding communication that is conspicuously marked or otherwise
|
| 61 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 62 |
+
|
| 63 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 64 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 65 |
+
subsequently incorporated within the Work.
|
| 66 |
+
|
| 67 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 68 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 69 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 70 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 71 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 72 |
+
Work and such Derivative Works in Source or Object form.
|
| 73 |
+
|
| 74 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 75 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 76 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 77 |
+
(except as stated in this section) patent license to make, have made,
|
| 78 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 79 |
+
where such license applies only to those patent claims licensable
|
| 80 |
+
by such Contributor that are necessarily infringed by their
|
| 81 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 82 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 83 |
+
institute patent litigation against any entity (including a
|
| 84 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 85 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 86 |
+
or contributory patent infringement, then any patent licenses
|
| 87 |
+
granted to You under this License for that Work shall terminate
|
| 88 |
+
as of the date such litigation is filed.
|
| 89 |
+
|
| 90 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 91 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 92 |
+
modifications, and in Source or Object form, provided that You
|
| 93 |
+
meet the following conditions:
|
| 94 |
+
|
| 95 |
+
(a) You must give any other recipients of the Work or
|
| 96 |
+
Derivative Works a copy of this License; and
|
| 97 |
+
|
| 98 |
+
(b) You must cause any modified files to carry prominent notices
|
| 99 |
+
stating that You changed the files; and
|
| 100 |
+
|
| 101 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 102 |
+
that You distribute, all copyright, patent, trademark, and
|
| 103 |
+
attribution notices from the Source form of the Work,
|
| 104 |
+
excluding those notices that do not pertain to any part of
|
| 105 |
+
the Derivative Works; and
|
| 106 |
+
|
| 107 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 108 |
+
distribution, then any Derivative Works that You distribute must
|
| 109 |
+
include a readable copy of the attribution notices contained
|
| 110 |
+
within such NOTICE file, excluding those notices that do not
|
| 111 |
+
pertain to any part of the Derivative Works, in at least one
|
| 112 |
+
of the following places: within a NOTICE text file distributed
|
| 113 |
+
as part of the Derivative Works; within the Source form or
|
| 114 |
+
documentation, if provided along with the Derivative Works; or,
|
| 115 |
+
within a display generated by the Derivative Works, if and
|
| 116 |
+
wherever such third-party notices normally appear. The contents
|
| 117 |
+
of the NOTICE file are for informational purposes only and
|
| 118 |
+
do not modify the License. You may add Your own attribution
|
| 119 |
+
notices within Derivative Works that You distribute, alongside
|
| 120 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 121 |
+
that such additional attribution notices cannot be construed
|
| 122 |
+
as modifying the License.
|
| 123 |
+
|
| 124 |
+
You may add Your own copyright statement to Your modifications and
|
| 125 |
+
may provide additional or different license terms and conditions
|
| 126 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 127 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 128 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 129 |
+
the conditions stated in this License.
|
| 130 |
+
|
| 131 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 132 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 133 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 134 |
+
this License, without any additional terms or conditions.
|
| 135 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 136 |
+
the terms of any separate license agreement you may have executed
|
| 137 |
+
with Licensor regarding such Contributions.
|
| 138 |
+
|
| 139 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 140 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 141 |
+
except as required for reasonable and customary use in describing the
|
| 142 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 143 |
+
|
| 144 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 145 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 146 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 147 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 148 |
+
implied, including, without limitation, any warranties or conditions
|
| 149 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 150 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 151 |
+
appropriateness of using or redistributing the Work and assume any
|
| 152 |
+
risks associated with Your exercise of permissions under this License.
|
| 153 |
+
|
| 154 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 155 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 156 |
+
unless required by applicable law (such as deliberate and grossly
|
| 157 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 158 |
+
liable to You for damages, including any direct, indirect, special,
|
| 159 |
+
incidental, or consequential damages of any character arising as a
|
| 160 |
+
result of this License or out of the use or inability to use the
|
| 161 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 162 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 163 |
+
other commercial damages or losses), even if such Contributor
|
| 164 |
+
has been advised of the possibility of such damages.
|
| 165 |
+
|
| 166 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 167 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 168 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 169 |
+
or other liability obligations and/or rights consistent with this
|
| 170 |
+
License. However, in accepting such obligations, You may act only
|
| 171 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 172 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 173 |
+
defend, and hold each Contributor harmless for any liability
|
| 174 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 175 |
+
of your accepting any such warranty or additional liability.
|
| 176 |
+
|
| 177 |
+
END OF TERMS AND CONDITIONS
|
| 178 |
+
|
| 179 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 180 |
+
|
| 181 |
+
To apply the Apache License to your work, attach the following
|
| 182 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 183 |
+
replaced with your own identifying information. (Don't include
|
| 184 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 185 |
+
comment syntax for the file format. We also recommend that a
|
| 186 |
+
file or class name and description of purpose be included on the
|
| 187 |
+
same "printed page" as the copyright notice for easier
|
| 188 |
+
identification within third-party archives.
|
| 189 |
+
|
| 190 |
+
Copyright [yyyy] [name of copyright owner]
|
| 191 |
+
|
| 192 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 193 |
+
you may not use this file except in compliance with the License.
|
| 194 |
+
You may obtain a copy of the License at
|
| 195 |
+
|
| 196 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 197 |
+
|
| 198 |
+
Unless required by applicable law or agreed to in writing, software
|
| 199 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 200 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 201 |
+
See the License for the specific language governing permissions and
|
| 202 |
+
limitations under the License.
|
provenance.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"acoustic_checkpoint_sha256": "e237160c1c2a8afc7a1f44ae323cd0a4d87fdba13826879139d546c4b7bfa472",
|
| 3 |
+
"vocoder_checkpoint_sha256": "9c007b9b4f58fa65d29b947e8ce09f3564638c0aca1bc60e0d02e182c81892b0",
|
| 4 |
+
"acoustic_step": 10413,
|
| 5 |
+
"vocoder_step": 29000,
|
| 6 |
+
"acoustic_training": {
|
| 7 |
+
"train_rows": 9255,
|
| 8 |
+
"dev_rows": 2337,
|
| 9 |
+
"train_hours": 19.09963390625,
|
| 10 |
+
"dev_hours": 5.477470677083333,
|
| 11 |
+
"held_rows": 4502,
|
| 12 |
+
"source_rows": 16094,
|
| 13 |
+
"label_field": "label",
|
| 14 |
+
"split": "parent recording SHA256 disjoint",
|
| 15 |
+
"epochs": 100,
|
| 16 |
+
"batch_size": 8,
|
| 17 |
+
"device": "cuda",
|
| 18 |
+
"initialization": "upstream warm weights; new Persian embedding and native 100-mel projection",
|
| 19 |
+
"vocoder": "frozen charactr/vocos-mel-24khz"
|
| 20 |
+
},
|
| 21 |
+
"grain_speech_commit": "8b38829809a6f86a9699371adc487c1efb875b05",
|
| 22 |
+
"acoustic_dataset": "Reza2kn/nasle-mana-clean-chunked-30s-avasanj",
|
| 23 |
+
"dataset_revision": "606ecdc1d93a77c6f3a452ab5721774248cdf587",
|
| 24 |
+
"g2p_source": "Negara v7.1 with overlay",
|
| 25 |
+
"waveform_training": "50,000 updates; generator selected on 96 dev excerpts; discriminators excluded",
|
| 26 |
+
"frontend_evaluation": null
|
| 27 |
+
}
|
pyproject.toml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[build-system]
|
| 2 |
+
requires = ["setuptools>=68"]
|
| 3 |
+
build-backend = "setuptools.build_meta"
|
| 4 |
+
[project]
|
| 5 |
+
name = "gooya-tts-experimental"
|
| 6 |
+
version = "2.0.0"
|
| 7 |
+
requires-python = ">=3.10"
|
| 8 |
+
dynamic = ["dependencies"]
|
| 9 |
+
[tool.setuptools.dynamic]
|
| 10 |
+
dependencies = {file = ["requirements.txt"]}
|
| 11 |
+
[tool.setuptools.packages.find]
|
| 12 |
+
include = ["gooya_tts*"]
|
requirements.txt
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
torch>=2.6,<3
|
| 2 |
+
transformers>=4.57,<6
|
| 3 |
+
safetensors>=0.5
|
| 4 |
+
huggingface_hub>=0.34
|
| 5 |
+
numpy>=1.26
|
| 6 |
+
soundfile>=0.12
|
| 7 |
+
einops>=0.8
|
verification.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"status": "passed",
|
| 3 |
+
"environment": "clean isolated Python venv; package copied into a temporary directory; empty HF cache; offline env flags; CPU inference",
|
| 4 |
+
"python": "3.13.11",
|
| 5 |
+
"sample_seconds": 17.412666666666667,
|
| 6 |
+
"sample_rate": 24000,
|
| 7 |
+
"sample_max_abs_delta_against_listened_reference": 0.0,
|
| 8 |
+
"sample_segments": 6,
|
| 9 |
+
"numeric_smoke_text": "\u0627\u0645\u0631\u0648\u0632 \u06f2\u06f4 \u0646\u0641\u0631 \u0622\u0645\u062f\u0646\u062f. \u0633\u0627\u0639\u062a \u06f3 \u0627\u0633\u062a.",
|
| 10 |
+
"numeric_smoke_seconds": 3.3186666666666667,
|
| 11 |
+
"checks": [
|
| 12 |
+
"strict safetensors state loading",
|
| 13 |
+
"exact architecture parameter count",
|
| 14 |
+
"nonempty finite audio",
|
| 15 |
+
"all G2P segments emitted EOS",
|
| 16 |
+
"requested sample waveform parity <1e-4",
|
| 17 |
+
"separate number-normalization inference"
|
| 18 |
+
],
|
| 19 |
+
"not_tested": [
|
| 20 |
+
"human accuracy of numeral sample",
|
| 21 |
+
"Windows/macOS/mobile runtime",
|
| 22 |
+
"FP16 or quantized inference",
|
| 23 |
+
"old-device latency"
|
| 24 |
+
]
|
| 25 |
+
}
|
vocoder.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:081fb32646d70590e52926115b13481753c6d846647111a502cc93c3295a0a67
|
| 3 |
+
size 3807768
|