Skip to content

Commit

Permalink
feat(examples): update tts (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yangqing authored Nov 7, 2023
1 parent eb0af3d commit 2a93292
Show file tree
Hide file tree
Showing 6 changed files with 660 additions and 433 deletions.
24 changes: 7 additions & 17 deletions advanced/tts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,20 @@ With this demo, you will be able to run deepfloyd and get results like follows:

and you can check out more details in the `tts.ipynb` notebook.

## Implementation note: mounting a gradio server

In is demo, we will not only show how to create multiple paths for a photon, but also include a Gradio UI:
```python
@Photon.handler(mount=True)
def ui(self):
blocks = gr.Blocks()
... # misc code that defines the blocks
return blocks
```
The UI will then be available at the `/ui/` address. For example, if you are running locally, it would be something like `http://0.0.0.0:8080/ui/`.

## Run tts locally

Ensure that you have installed the required dependencies via `pip install -r requirements.txt`. Then, run:
```shell
python tts.py
python tts_main.py
```
Note that if you have a GPU, things will run much faster. When the program runs, visit `http://0.0.0.0:8080/ui/` for the web UI, or use the client to access it in a programmatical way.
Note that if you have a GPU, things will run much faster. When the program runs, visit `http://0.0.0.0:8080/doc/` for the openapi doc, or use the client to access it in a programmatical way.

## Run tts in the cloud

Similar to other examples, you can run tts with the following command:

```shell
lep photon create -n tts -m tts.py
lep photon push -n tts
lep photon run -n tts --resource-shape gpu.t4
lep photon run -n tts -m tts_main.py --resource-shape gpu.t4
```

And visit [dashboard.lepton.ai](https://dashboard.lepton.ai/) to try out the model.
Expand All @@ -47,3 +33,7 @@ lep deployment update -n tts --public
```

You can then use tts either via the UI or via the client. See the notebook example for more details.

## XTTS

We also include an XTTS example that can be used to do voice cloning. More details to be written.
4 changes: 2 additions & 2 deletions advanced/tts/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
gradio
leptonai
TTS
TTS
deepspeed
331 changes: 181 additions & 150 deletions advanced/tts/tts.ipynb

Large diffs are not rendered by default.

264 changes: 0 additions & 264 deletions advanced/tts/tts.py

This file was deleted.

Loading

0 comments on commit 2a93292

Please sign in to comment.