Skip to content

Commit

Permalink
feat: write a regression test suite that can be sbatch submitted
Browse files Browse the repository at this point in the history
Starting to address #611
  • Loading branch information
joanise committed Dec 20, 2024
1 parent 53c383b commit 8d7f6ab
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 0 deletions.
52 changes: 52 additions & 0 deletions everyvoice/tests/regress-lj2k-resume
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
- - EveryVoice Wizard
- 0.2.0a1
- - Root
- null
- - Name Step
- regress
- - Contact Name Step
- EveryVoice Regressor
- - Contact Email Step
- [email protected]
- - Output Path Step
- .
- - Filelist Step
- metadata.csv
- - Dataset Permission Step
- Yes, I do have permission to use this data.
- - Filelist Format Step
- psv
- - Filelist Has Header Line Step
- 'no'
- - Basename Header Step
- 0
- - Text Header Step
- 1
- - Filelist Text Representation Step
- characters
- - Text Processing Step
- - 0
- 1
- - Data Has Speaker Step
- 'no'
- - Know Speaker Step
- 'no'
- - Data Has Language Step
- 'no'
- - Select Language Step
- '[eng]: English'
- - Wavs Dir Step
- wavs
- - Validate Wavs Step
- OK
- - Symbol-Set Step
- true
- - SoX Effects Step
- - 0
- 1
- - Dataset Name Step
- lj2k
- - More Datasets Step
- 'no'
- - Config Format Step
- 'yaml'
4 changes: 4 additions & 0 deletions everyvoice/tests/regress-text.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This is a test.
I am an anvil.
I have no idea what to write here, but it has to be synthesizable text; so here is something!
Boo!
62 changes: 62 additions & 0 deletions everyvoice/tests/regression-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash

#SBATCH --job-name=EV-regress
#SBATCH --partition=gpu_a100
#SBATCH --account=nrc_ict__gpu_a100
#SBATCH --qos=low
#SBATCH --time=180
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --mem=16000M
#SBATCH --gres=gpu:1

set -o errexit

# User env config -- adjust this as necessary before running:
ACTIVATE_SCRIPT=$HOME/start_ev.sh
LJ_SPEECH_DATASET=$HOME/tts/corpora/Speech/LJ.Speech.Dataset/LJSpeech-1.1

# Regression config
source "$ACTIVATE_SCRIPT"
LINES_TO_USE=2000
EVERYVOICE_ROOT=$(python -c 'import everyvoice; print(everyvoice.__path__[0])')
DATE=$(date +'%Y%m%d')
WORKDIR=regress-$DATE
mkdir "$WORKDIR"
cd "$WORKDIR"

# 1: create a small dataset
head -"$LINES_TO_USE" "$LJ_SPEECH_DATASET/metadata.csv" > metadata.csv
ln -s "$LJ_SPEECH_DATASET/wavs" .

# 2: run the new-project wizard
everyvoice new-project --resume-from "$EVERYVOICE_ROOT/tests/regress-lj2k-resume"

# 3: preprocess
cd regress
everyvoice preprocess config/everyvoice-text-to-spec.yaml

# 4: train the fs2 model
everyvoice train text-to-spec config/everyvoice-text-to-spec.yaml --config-args training.max_epochs=10
FS2=logs_and_checkpoints/FeaturePredictionExperiment/base/checkpoints/last.ckpt
ls $FS2

# 5: train the vocoder
everyvoice train spec-to-wav config/everyvoice-spec-to-wav.yaml --config-args training.max_epochs=10
VOCODER=logs_and_checkpoints/VocoderExperiment/base/checkpoints/last.ckpt
ls $VOCODER

# 6: synthesize some text
everyvoice synthesize from-text \
--output-type wav --output-type spec --output-type textgrid --output-type readalong-xml --output-type readalong-html \
--filelist "$EVERYVOICE_ROOT/tests/regress-text.txt" \
--vocoder-path $VOCODER \
$FS2
# TODO: check the synthesized files, somehow

# 7: spin up the demo
# everyvoice demo $FS2 $VOCODER &


# 8: use playwright to synthesize something using the demo
# TODO...

0 comments on commit 8d7f6ab

Please sign in to comment.