Speech synthesis using Spotify's podcast dataset https://podcastsdataset.byspotify.com/
After cloning the repo, create a virtual environment with Poetry:
- If you don't have Poetry, follow these instructions to get it
- Run
poetry install
to set up a virtual environment
Run poetry shell
to spawn a new shell within the virtual environment. Python will now see all the packages which are installed in the virtual environment, instead of those installed globally on your system.
To exit the shell, just do as you would with any shelld - exit
or ctrl+d
.
Within the virtual environment, run guild run <operation>
to run a piece of the pipeline. You'll find a list of available operations by running guild help
.
That operation will then run in an isloated directory made specifically for it. To take a look at the operations output, use guild runs
to list all operations you have run and then guild open <operation-number>
to open your file browser.
You can re-run an operation any number of times, its output will always be saved to a new directory (runs do not interfere with each other).
Whenever you want to use a new package in the project:
- Decide if it's a dev dependency or not. Dev dependencies are packages which aren't actually needed for running the code, only for development (eg. a linter).
poetry add <package>
orpoetry add --dev <package>
- commit changes to
pyproject.toml
andpoetry.lock
Whenever someone else changed dependencies and you pull the changes: poetry install
.
When you want to add a guild
operation:
- Write a Python script which does the actual thing
- If there is something you might want to supply as a command-line argument, make it a global variable
- If your script needs to use the output of another operation (eg. spectrogram generation will need the output of
download-audio
), just pretend that what you need is in the current working directory - Save the script's output to the current working directory as well
- Add the operation to
guild.yml
- If your script uses the output of another operation, specify the name of that resource in the
requires
attribute - for example, you could create aspectrogram
operation which requiresaudio
- The names of resources are to be found in the
resources
section ofguild.yml
- The names of resources are to be found in the
- If your script produces output that you might want to use in another operation, register that fact in
resources
- for example, see howdownload-audio
produces theaudio
resource - Use
flags-import: all
forguild
to detect what your script wants as command-line arguments
- If your script uses the output of another operation, specify the name of that resource in the
- Commit the script and changes to
guild.yml
You can always refer to the guild
documentation here.
To make your code pretty on save, ask your editor to format it with black
(installed as a dev dependency already). In VS Code, you can do this in the settings ("Editor: format on save").