From 620de4c528e0d067cc95c7e79da0f529e6bb6ba2 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Fri, 10 Sep 2021 04:21:47 -0400 Subject: [PATCH] Update tts_models schema to track TalkNet-related details --- .../down.sql | 15 +++++++++++++++ .../up.sql | 19 +++++++++++++++++++ migrations_squashed/tts_tables/tts_models.sql | 16 ++++++++++++++++ src/database/helpers/enums.rs | 2 ++ 4 files changed, 52 insertions(+) create mode 100644 migrations/2021-09-10-074547_alter_tables_talknet_metadata/down.sql create mode 100644 migrations/2021-09-10-074547_alter_tables_talknet_metadata/up.sql diff --git a/migrations/2021-09-10-074547_alter_tables_talknet_metadata/down.sql b/migrations/2021-09-10-074547_alter_tables_talknet_metadata/down.sql new file mode 100644 index 0000000000..1da108803b --- /dev/null +++ b/migrations/2021-09-10-074547_alter_tables_talknet_metadata/down.sql @@ -0,0 +1,15 @@ +-- noinspection SqlDialectInspectionForFile +-- noinspection SqlNoDataSourceInspectionForFile +-- noinspection SqlResolveForFile + +ALTER TABLE tts_models +DROP COLUMN private_bucket_object_is_archive; + +ALTER TABLE tts_models +DROP COLUMN has_self_contained_vocoder; + +ALTER TABLE tts_models +DROP COLUMN has_self_contained_duration_model; + +ALTER TABLE tts_models +DROP COLUMN has_self_contained_pitch_model; diff --git a/migrations/2021-09-10-074547_alter_tables_talknet_metadata/up.sql b/migrations/2021-09-10-074547_alter_tables_talknet_metadata/up.sql new file mode 100644 index 0000000000..e0715f0878 --- /dev/null +++ b/migrations/2021-09-10-074547_alter_tables_talknet_metadata/up.sql @@ -0,0 +1,19 @@ +-- noinspection SqlDialectInspectionForFile +-- noinspection SqlNoDataSourceInspectionForFile +-- noinspection SqlResolveForFile + +ALTER TABLE tts_models +ADD COLUMN private_bucket_object_is_archive BOOLEAN NOT NULL DEFAULT FALSE +AFTER private_bucket_object_name; + +ALTER TABLE tts_models +ADD COLUMN has_self_contained_vocoder BOOLEAN NOT NULL DEFAULT FALSE +AFTER tts_model_type; + +ALTER TABLE tts_models +ADD COLUMN has_self_contained_duration_model BOOLEAN NOT NULL DEFAULT FALSE +AFTER has_self_contained_vocoder; + +ALTER TABLE tts_models +ADD COLUMN has_self_contained_pitch_model BOOLEAN NOT NULL DEFAULT FALSE +AFTER has_self_contained_duration_model; diff --git a/migrations_squashed/tts_tables/tts_models.sql b/migrations_squashed/tts_tables/tts_models.sql index b6ccf77563..41a03f70a4 100644 --- a/migrations_squashed/tts_tables/tts_models.sql +++ b/migrations_squashed/tts_tables/tts_models.sql @@ -22,6 +22,18 @@ CREATE TABLE tts_models ( 'talknet' ) NOT NULL DEFAULT 'not-set', + -- For models distributed as archives/bundles (eg. TalkNet), we can pack + -- in a vocoder. Note that this vocoder does not have to be used. + has_self_contained_vocoder BOOLEAN NOT NULL DEFAULT FALSE, + + -- For models distributed as archives/bundles (eg. TalkNet), we can pack + -- in a duration model. + has_self_contained_duration_model BOOLEAN NOT NULL DEFAULT FALSE, + + -- For models distributed as archives/bundles (eg. TalkNet), we can pack + -- in a pitch model. + has_self_contained_pitch_model BOOLEAN NOT NULL DEFAULT FALSE, + -- NB: DO NOT CHANGE ORDER; APPEND ONLY! -- How text should be handled. text_preprocessing_algorithm ENUM( @@ -30,6 +42,7 @@ CREATE TABLE tts_models ( ) NOT NULL DEFAULT 'basic', -- If set, use a different pretrained vocoder. + -- If not set, use the website default. (Currently HifiGan-SS) maybe_default_pretrained_vocoder VARCHAR(64) DEFAULT NULL, -- Optional Pointer to a newer version of the voice @@ -109,6 +122,9 @@ CREATE TABLE tts_models ( -- The "full url" version of the path private_bucket_object_name VARCHAR(255) NOT NULL, + -- Whether the file is a zip archive (rather than a model file). + private_bucket_object_is_archive BOOLEAN NOT NULL DEFAULT FALSE, + -- ========== RATING AND RANKING ========== -- Calculated average, on a scale of 0-100 diff --git a/src/database/helpers/enums.rs b/src/database/helpers/enums.rs index 6e49c85ab7..71f915ab4b 100644 --- a/src/database/helpers/enums.rs +++ b/src/database/helpers/enums.rs @@ -26,6 +26,8 @@ pub enum TtsModelType { GlowTts, /// glowtts-vocodes GlowTts_Vocodes, + /// talknet + Talknet, } #[derive(Deserialize)]