diff --git a/crates/lib/mysql_queries/src/payloads/generic_inference_args/tts_payload.rs b/crates/lib/mysql_queries/src/payloads/generic_inference_args/tts_payload.rs index 06892accda..6a3aeff9b8 100644 --- a/crates/lib/mysql_queries/src/payloads/generic_inference_args/tts_payload.rs +++ b/crates/lib/mysql_queries/src/payloads/generic_inference_args/tts_payload.rs @@ -5,7 +5,7 @@ pub struct TTSArgs { pub text: String, #[serde(rename = "e")] #[serde(skip_serializing_if = "Option::is_none")] - pub maybe_voice_token: Option // varchar 32 + pub voice_token: String // varchar 32 } #[cfg(test)] diff --git a/crates/service/job/inference_job/src/job/job_types/tts/mod.rs b/crates/service/job/inference_job/src/job/job_types/tts/mod.rs index 80c6c0b2c9..729c17f0ed 100644 --- a/crates/service/job/inference_job/src/job/job_types/tts/mod.rs +++ b/crates/service/job/inference_job/src/job/job_types/tts/mod.rs @@ -1,3 +1,4 @@ pub mod process_single_tts_job; pub mod tacotron2_v2_early_fakeyou; pub mod vits; +pub mod vallEX; diff --git a/crates/service/job/inference_job/src/job_dependencies.rs b/crates/service/job/inference_job/src/job_dependencies.rs index b08251152e..a7ceb4b90e 100644 --- a/crates/service/job/inference_job/src/job_dependencies.rs +++ b/crates/service/job/inference_job/src/job_dependencies.rs @@ -161,6 +161,7 @@ pub struct JobTypeDetails { pub rvc_v2: RvcV2Details, pub so_vits_svc: SoVitsSvcDetails, pub sad_talker: SadTalkerDetails, + pub vallEX: VallEXDetails //pub tacotron2_modern: ..., //pub softvc: ..., } @@ -196,3 +197,10 @@ pub struct SadTalkerDetails { pub inference_command: SadTalkerInferenceCommand, pub ffmpeg_watermark_command: FfmpegLogoWatermarkCommand, } + +// TODO: we will probably want a command type of some kind that implements +// some kind of interface that we can just pass strings to. +pub struct VallEXDetails { + pub inference_command: VallEXInferenceCommand, + pub create_embedding_command: VallEXCreateEmbeddingCommand +} \ No newline at end of file diff --git a/crates/service/job/inference_job/src/main.rs b/crates/service/job/inference_job/src/main.rs index 8c8b94d2b6..0123051b98 100644 --- a/crates/service/job/inference_job/src/main.rs +++ b/crates/service/job/inference_job/src/main.rs @@ -57,7 +57,7 @@ use crate::job::job_types::tts::vits::vits_inference_command::VitsInferenceComma use crate::job::job_types::vc::rvc_v2::pretrained_hubert_model::PretrainedHubertModel; use crate::job::job_types::vc::rvc_v2::rvc_v2_inference_command::RvcV2InferenceCommand; use crate::job::job_types::vc::so_vits_svc::so_vits_svc_inference_command::SoVitsSvcInferenceCommand; -use crate::job_dependencies::{FileSystemDetails, JobCaches, JobDependencies, JobTypeDetails, JobWorkerDetails, PretrainedModels, RvcV2Details, SadTalkerDetails, SoVitsSvcDetails, Tacotron2VocodesDetails, VitsDetails}; +use crate::job_dependencies::{FileSystemDetails, JobCaches, JobDependencies, JobTypeDetails, JobWorkerDetails, PretrainedModels, RvcV2Details, SadTalkerDetails, SoVitsSvcDetails, Tacotron2VocodesDetails, VitsDetails, VallEXDetails}; use crate::util::common_commands::ffmpeg_logo_watermark_command::FfmpegLogoWatermarkCommand; use crate::util::scoped_execution::ScopedExecution; use crate::util::scoped_temp_dir_creator::ScopedTempDirCreator; @@ -307,6 +307,10 @@ async fn main() -> AnyhowResult<()> { hifigan_vocoder_model_filename, hifigan_superres_vocoder_model_filename, }, + vallEX: VallEXDetails { + inference_command: "", + create_embedding_command: "" + }, vits: VitsDetails { inference_command: vits_inference_command()?, }, diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/animation/enqueue_lipsync_animation.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/animation/enqueue_lipsync_animation.rs index 33d5ebb940..e44f91e373 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/animation/enqueue_lipsync_animation.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/animation/enqueue_lipsync_animation.rs @@ -332,6 +332,8 @@ pub async fn enqueue_lipsync_animation_handler( } }; + // If you are using this file as a reference for another generic endpoint feature. + // this feature will be sunset so don't worry about this server_state.firehose_publisher.enqueue_lipsync_animation( maybe_user_token.as_ref(), &job_token) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/voice_designer/enqueue_tts_request.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/voice_designer/enqueue_tts_request.rs index 6228b71aac..8dee73bfb6 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/voice_designer/enqueue_tts_request.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/voice_designer/enqueue_tts_request.rs @@ -9,7 +9,7 @@ use std::sync::Arc; use actix_web::{HttpRequest, HttpResponse, web}; use actix_web::error::ResponseError; use actix_web::http::StatusCode; -use log::{info, warn}; +use log::{warn}; use http_server_common::request::get_request_ip::get_request_ip; use tokens::users::user::UserToken; @@ -87,21 +87,22 @@ pub async fn enqueue_tts_request( request: web::Json, server_state: web::Data>) -> Result { + println!("Recieved payload"); let is_debug_request = true; - let mut maybe_user_token : Option = None; + let maybe_user_token : Option = Some(UserToken::new_from_str(&"place holder")); let priority_level = 0; - let disable_rate_limiter = false; // NB: Careful! + //let disable_rate_limiter = false; // NB: Careful! // do something with user session check if the user should even be able to access the end point // GET MY SQL - let mut mysql_connection = server_state.mysql_pool - .acquire() - .await - .map_err(|err| { - warn!("MySql pool error: {:?}", err); - EnqueueTTSRequestError::ServerError - })?; + // let mut mysql_connection = server_state.mysql_pool + // .acquire() + // .await + // .map_err(|err| { + // warn!("MySql pool error: {:?}", err); + // EnqueueTTSRequestError::ServerError + // })?; // TODO: check for session @@ -123,10 +124,10 @@ pub async fn enqueue_tts_request( // Get up IP address let ip_address = get_request_ip(&http_request); -// package as larger component args -let mut inference_args = TTSArgs { - text: "Hello!".to_string(), - maybe_voice_token: Some("Voice Token.".to_string()) +// package as larger component args should always have an embedding token .. +let inference_args = TTSArgs { + text: request.text, + maybe_voice_token: request.embedding_token }; // create the inference args here @@ -167,11 +168,9 @@ let response: EnqueueTTSRequestSuccessResponse = EnqueueTTSRequestSuccessRespons inference_job_token: job_token, }; - let body = serde_json::to_string(&response) .map_err(|_e| EnqueueTTSRequestError::ServerError)?; - // Error handling 101 rust result type returned like so. Ok(HttpResponse::Ok() .content_type("application/json")