Skip to content

Commit

Permalink
StyleTTS2 Demo Notebook (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsxdalv authored Mar 14, 2024
1 parent c71e1a7 commit c1013de
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN pip3 install -r requirements_audiocraft_deps.txt
RUN pip3 install -r requirements_bark_hubert_quantizer.txt
RUN pip3 install -r requirements_rvc.txt
RUN pip3 install hydra-core==1.3.2
RUN pip3 install -r requirements_styletts2.txt

# Add React webui (testing)
# RUN cd react-ui && npm install && npm run build
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ https://rsxdalv.github.io/bark-speaker-directory/
https://github.com/rsxdalv/tts-generation-webui/discussions/186#discussioncomment-7291274

## Changelog
Mar 14:
* StyleTTS2 Demo Notebook

Mar 13:
* Add Experimental Pipeline (Bark / Tortoise / MusicGen / AudioGen / MAGNeT -> RVC / Demucs / Vocos) (#287)
* Fix RVC bug with model reloading on each generation. For short inputs that results in a visible speedup.
Expand Down
46 changes: 46 additions & 0 deletions notebooks/styleTTS2.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from styletts2 import tts\n",
"\n",
"# No paths provided means default checkpoints/configs will be downloaded/cached.\n",
"my_tts = tts.StyleTTS2()\n",
"\n",
"# Optionally create/write an output WAV file.\n",
"out = my_tts.inference(\"Hello there, I am now a python package.\", output_wav_file=\"test.wav\")\n",
"\n",
"# Specific paths to a checkpoint and config can also be provided.\n",
"# other_tts = tts.StyleTTS2(model_checkpoint_path='/PATH/TO/epochs_2nd_00020.pth', config_path='/PATH/TO/config.yml')\n",
"\n",
"# # Specify target voice to clone. When no target voice is provided, a default voice will be used.\n",
"# other_tts.inference(\"Hello there, I am now a python package.\", target_voice_path=\"/PATH/TO/some_voice.wav\", output_wav_file=\"another_test.wav\")\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
2 changes: 2 additions & 0 deletions requirements_styletts2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
torch==2.0.0 # BSD 3-Clause - ensures torch is not reinstalled
styletts2 @ git+https://github.com/rsxdalv/StyleTTS2@cc36a19610df42123230237a73e798d4fdd3dcb8#egg=styletts2 # MIT License
1 change: 1 addition & 0 deletions update.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def main():
try_install("requirements_rvc.txt", "RVC")
# hydracore fix because of fairseq
do("pip install hydra-core==1.3.2")
try_install("requirements_styletts2.txt", "StyleTTS")

if is_node_installed():
setup_node_modules()
Expand Down

0 comments on commit c1013de

Please sign in to comment.