Skip to main content

tungnaa is a text-to-voice model family and musical instrument

Project description

Tungnaa Interactive Voice Instruments

Training and GUI inference for interactive artistic text-to-voice models.

We would love to hear your feedback on using Tungnaá in this short survey: https://forms.gle/F97yhJ1YB5aiZPmn7

Try it now with uv

uvx --with "tungnaa[gui]" tungnaa run

Installation in a Python environment

pip install tungnaa[gui] (if you just want to use Tungnaá)

pip install tungnaa[train] (if you want to train your own models)

Usage

tungnaa --help

Running with the Python Audio Engine

  • #todo model selection from the Tungnaa gui, including block size and sample rate that match system (currently not possible to have a SR mismatch)
  • #todo audio device selection from the Tungnaa gui
tungnaa run --audio-out default

use tungnaa list-devices to get audio devices by index

Using SuperCollider, PureData or Max as Audio Engine

If --latent-audio switch is enabled, Tungnaa will stream RAVE latent trajectories over a single audio-rate channel, which can be piped into another audio engine running the RAVE vocoder. The piping can be done relatively easily on Linux using JACK, and on MacOS using Blackhole.

SuperCollider: sclang supercollider/rtvoice-demo.scd

tungnaa run --latent_audio

Training Models

vocoder training

using victor-shepardson RAVE fork

example preprocessing with joining of short files (especially useful for datasets containing many short utterances)

rave preprocess \
--input_path /path/to/audio/directory \
--output_path /path/to/tmp/storage/myravedata \
--num_signal 150000 --sampling_rate 48000 \
--join_short_files

example transfer learning using IIL rave-models:

rave train --name 001-my-vocoder-name \
--config rave-models/voice_multi_b2048_r48000/config.gin --config transfer \
--db_path /path/to/tmp/storage/myravedata \
--out_path /path/to/rave/runs \
--transfer_ckpt rave-models/voice_multi_b2048_r48000/version_0/checkpoints/last.ckpt \
--n_signal 150000
--gpu 0

example export using sign normalization (latents correlate with louder/brighter sounds):

rave export --run /path/to/rave/runs/001-my-vocoder-name \
--streaming --normalize_sign --latent_size ...

Tungnaá preprocessing

see tungnaa prep --help.

To use datasets other than vctk or hifitts, it may be necessary to add an adapter function in prep.py.

example:

tungnaa prep \
--datasets '{kind:"vctk", path:"/path/to/VCTK"}' \
--rave-path /path/to/rave_streaming.ts \
--out-path /path/to/tmp/dataset_name

training

see tungnaa trainer --help

example:

tungnaa trainer --experiment 001-my-tts-name \
--model-dir /path/for/checkpoints \
--log-dir /path/for/logs \
--manifest /path/to/tmp/dataset_name/manifest.json \
--rave-model /path/to/rave_streaming.ts 
--lr 3e-4 --lr-text 3e-5 --epoch-size 200 --save-epochs 20 \
--device cuda:0 \
train 

resume a stopped training: add --checkpoint /path/to/checkpoint

transfer learning: add --checkpoint /path/to/checkpoint --resume False

in-text annotations

--speaker_annotate prepends the speaker id determined during prepreprocessing. With --speaker_dataset, it includes the dataset.

--csv /path/to/file.csv accepts a jvs_labels_encoder_k7.csv-style CSV file. First column contains the audio filename without extension, second column contains an annotation to be prepended to text.

If you were to use all three options, you would get:

"csvval:[dataset:speaker] original text"

Developing

uv is used for packaging and dependency management. After installing uv, to get a working dev environment:

  1. git clone git@github.com:tungnaa/tungnaa.git
  2. cd tungnaa
  3. uv lock
  4. uv sync --extra gui --extra train

To add a dependency, use uv add, or edit pyproject.toml and then run uv lock; uv sync.

Models are stored in a sister huggingface repo, or in any similarly structured repo. Tungnaá models should go in models/tts/mymodel.ckpt, and be accompanied by a mymodel.md file. Vocoders should go in models/vocoders/myvocoder.ts.

docs

run mkdocs serve to build and view documentation

run mkdocs gh-deploy to deploy to github pages

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tungnaa-0.3.0.tar.gz (87.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tungnaa-0.3.0-py3-none-any.whl (91.0 kB view details)

Uploaded Python 3

File details

Details for the file tungnaa-0.3.0.tar.gz.

File metadata

  • Download URL: tungnaa-0.3.0.tar.gz
  • Upload date:
  • Size: 87.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tungnaa-0.3.0.tar.gz
Algorithm Hash digest
SHA256 665b0b24360280ac3749c3e4392ecb3592ba3e449d57a949907bce344bfc8eeb
MD5 6e16159974fc174e98655b5e70affe36
BLAKE2b-256 bd0651334453b858be34229052a04e663f9b12b97e6ba56518219b0a394d1a57

See more details on using hashes here.

File details

Details for the file tungnaa-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: tungnaa-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 91.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tungnaa-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b36e56f85e9459eb58ec54393010989c53acf1f6c2f46db4370a89815686f187
MD5 10626c52e3b612b991dfe7d5c74cea86
BLAKE2b-256 7c631cdddf432d6ceb3527ebf2f23f2872a826470e6d9558403fe5be6587cee3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page