Coder Social home page Coder Social logo

vall-e-encodec's Introduction

vall-e-encodec

Baseline text to mhubert unit

https://huggingface.co/voidful/mhubert-unit-tts

To train the mhubert model for generating text to unit, follow the steps below:

  1. Install the tfkit package using pip:
pip install tfkit
  1. Create a unit dataset by running speech2unit.py. The speech2unit.py script generates train.csv and test.csv files that will be used for training and testing respectively. You can run the script with the following command:
python speech2unit.py --model mhubert_layer11_code1000 --ds superb --ds_split asr

Alternatively, you can create train.csv and test.csv manually, with code_str = "".join(f"v_tok_{tok}" for tok in code).

  1. Train the mhubert model to generate text to unit using the tfkit-train command. The --epoch parameter specifies the number of epochs to train the model for, --handle_exceed removes the exceeded samples, --train specifies the path of the training dataset, --test specifies the path of the testing dataset, --no_eval disables the evaluation of the model during training, --task specifies the type of task as "seq2seq", --config specifies the configuration of the model to use, --worker specifies the number of workers to use, --grad_accum specifies the number of gradient accumulation steps, --batch specifies the batch size, and --wandb logs the training process to Weights and Biases.
tfkit-train \
--epoch 20 \
--handle_exceed remove \
--train ./text_to_mhubert/train.csv \
--test ./text_to_mhubert/test.csv \
--no_eval \
--task seq2seq \
--config voidful/bart-base-unit \
--worker 15 \
--grad_accum 2 \
--batch 3 \
--wandb
  1. (Optional) Evaluate the generated unit with the ground truth unit using the tfkit-eval command. The --model parameter specifies the path of the trained model checkpoint, --valid specifies the path of the validation dataset, and --metric specifies the evaluation metric as "er".
tfkit-eval --model ./checkpoints/ --valid ./text_to_mhubert/test.csv --metric er
  1. Dump the trained model in Huggingface's format using the tfkit-dump command. The --model parameter specifies the path of the trained model checkpoint, and --output specifies the path of the dumped model.
tfkit-dump --model ./checkpoints/5.pt --output ./dumped_model

vall-e-encodec's People

Contributors

lca0503 avatar voidful avatar hsutim047 avatar

Forkers

edward0804

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.