improvements

This commit is contained in:
Brandon Thomas committed 2021-06-04 02:06:52 -04:00
1 parent cda1bbda41
commit 870eba8a9c
3 files changed
+21 -4

No files matched your search

@@ -18,6 +18,13 @@ CREATE TABLE tts_models (
'glowtts-vocodes'
) NOT NULL DEFAULT 'not-set',
-- NB: DO NOT CHANGE ORDER; APPEND ONLY!
-- How text should be handled.
text_preprocessing_algorithm ENUM(
'basic-preprocess',
'arpabet-preprocess'
) NOT NULL DEFAULT 'basic-preprocess',
-- Optional Pointer to a newer version of the voice
-- If there's a newer version, we can disable this one.
maybe_updated_model_token VARCHAR(32) DEFAULT NULL,
@@ -36,6 +36,7 @@ pub struct GetTtsModelPathInfo {
pub struct TtsModelRecordForResponse {
pub model_token: String,
pub tts_model_type: String,
pub text_preprocessing_algorithm: String,
pub creator_user_token: String,
pub creator_username: String,
@@ -69,6 +70,7 @@ pub enum GetTtsModelError {
pub struct TtsModelRecord {
pub model_token: String,
pub tts_model_type: String,
pub text_preprocessing_algorithm: String,
pub creator_user_token: String,
pub creator_username: String,
@@ -122,6 +124,7 @@ pub async fn get_tts_model_handler(
SELECT
tts.token as model_token,
tts.tts_model_type,
tts.text_preprocessing_algorithm,
tts.creator_user_token,
users.username as creator_username,
@@ -161,6 +164,7 @@ AND tts.deleted_at IS NULL
let model_for_response = TtsModelRecordForResponse {
model_token: template.model_token.clone(),
tts_model_type: template.tts_model_type.clone(),
text_preprocessing_algorithm: template.text_preprocessing_algorithm.clone(),
creator_user_token: template.creator_user_token.clone(),
creator_username: template.creator_username.clone(),
creator_display_name: template.creator_display_name.clone(),
@@ -35,9 +35,10 @@ pub struct GetTtsResultPathInfo {
#[derive(Serialize)]
pub struct TtsResultRecordForResponse {
pub tts_result_token: String,
pub inference_text: String,
pub tts_model_token: String,
pub inference_text: String,
pub tts_model_title: Option<String>, // TODO: Shouldn't be Option.
pub maybe_creator_user_token: Option<String>,
pub maybe_creator_username: Option<String>,
@@ -82,9 +83,10 @@ pub enum GetTtsResultError {
pub struct RawTtsResultRecord {
pub tts_result_token: String, // from field `tts_results.token`
pub inference_text: String,
pub tts_model_token: String,
pub inference_text: String,
pub tts_model_title: Option<String>,
pub maybe_creator_user_token: Option<String>,
pub maybe_creator_username: Option<String>,
@@ -151,9 +153,11 @@ pub async fn get_tts_inference_result_handler(
SELECT
tts_results.token as tts_result_token,
tts_results.model_token as tts_model_token,
tts_results.inference_text,
tts_results.model_token as tts_model_token,
tts_models.title as tts_model_title,
users.token as maybe_creator_user_token,
users.username as maybe_creator_username,
users.display_name as maybe_creator_display_name,
@@ -206,9 +210,11 @@ WHERE
let result_for_response = TtsResultRecordForResponse {
tts_result_token: ir.tts_result_token.clone(),
tts_model_token: ir.tts_model_token.clone(),
inference_text: ir.inference_text.clone(),
tts_model_token: ir.tts_model_token.clone(),
tts_model_title: ir.tts_model_title.clone(),
maybe_creator_user_token: ir.maybe_creator_user_token.clone(),
maybe_creator_username: ir.maybe_creator_username.clone(),
maybe_creator_display_name: ir.maybe_creator_display_name.clone(),