Skip to content

Commit

Permalink
fix: make bangla g2p deps optional
Browse files Browse the repository at this point in the history
  • Loading branch information
eginhard committed May 8, 2024
1 parent d54acb7 commit 73cfeb5
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
sed -i 's/https:\/\/coqui.gateway.scarf.sh\//https:\/\/github.com\/coqui-ai\/TTS\/releases\/download\//g' TTS/.models.json
- name: Install TTS
run: |
python3 -m uv pip install --system "coqui-tts[dev,server,ja] @ ."
python3 -m uv pip install --system "coqui-tts[dev,server,languages] @ ."
python3 setup.py egg_info
- name: Unit tests
run: make ${{ matrix.subset }}
Expand Down
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,33 @@ If you plan to code or train models, clone 🐸TTS and install it locally.

```bash
git clone https://github.com/idiap/coqui-ai-TTS
pip install -e .[all,dev,notebooks,server] # Select the relevant extras
pip install -e .
```

### Optional dependencies

The following extras allow the installation of optional dependencies:

| Name | Description |
|------|-------------|
| `all` | All optional dependencies, except `dev` and `docs` |
| `dev` | Development dependencies |
| `dev` | Dependencies for building the documentation |
| `notebooks` | Dependencies only used in notebooks |
| `server` | Dependencies to run the TTS server |
| `bn` | Bangla G2P |
| `ja` | Japanese G2P |
| `languages` | All language-specific dependencies |

You can install them with one of the following commands:

```bash
pip install coqui-tts[server,ja]
pip install -e .[server,ja]
```

### Platforms

If you are on Ubuntu (Debian), you can also run following commands for installation.

```bash
Expand Down
9 changes: 6 additions & 3 deletions TTS/tts/utils/text/bangla/phonemizer.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import re

import bangla
from bnnumerizer import numerize
from bnunicodenormalizer import Normalizer
try:
import bangla
from bnnumerizer import numerize
from bnunicodenormalizer import Normalizer
except ImportError as e:
raise ImportError("Bangla requires: bangla, bnnumerizer, bnunicodenormalizer") from e

# initialize
bnorm = Normalizer()
Expand Down
14 changes: 10 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ dependencies = [
"g2pkk>=0.1.1",
# Gruut + supported languages
"gruut[de,es,fr]==2.2.3",
# Bangla
"bangla",
"bnnumerizer",
"bnunicodenormalizer",
# Tortoise
"einops>=0.6.0",
"transformers>=4.33.0",
Expand Down Expand Up @@ -115,12 +111,22 @@ notebooks = [
# For running the TTS server
server = ["flask>=2.0.1"]
# Language-specific dependencies, mainly for G2P
# Bangla
bn = [
"bangla",
"bnnumerizer",
"bnunicodenormalizer",
]
# Japanese
ja = [
"mecab-python3",
"unidic-lite==1.0.8",
"cutlet",
]
# All language-specific dependencies
languages = [
"coqui-tts[bn,ja]",
]
# Installs all extras (except dev and docs)
all = [
"coqui-tts[notebooks,server,ja]",
Expand Down

0 comments on commit 73cfeb5

Please sign in to comment.