mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 17:38:10 +00:00
Fix a build issues the payload sends exploring the job creation and inference side of it.
This commit is contained in:
1 parent
e0145f0e70
commit
5de40b2dab
6 files changed
+32
-18
No files matched your search
@@ -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<String> // varchar 32
|
||||
pub voice_token: String // varchar 32
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
pub mod process_single_tts_job;
|
||||
pub mod tacotron2_v2_early_fakeyou;
|
||||
pub mod vits;
|
||||
pub mod vallEX;
|
||||
@@ -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
|
||||
}
|
||||
@@ -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()?,
|
||||
},
|
||||
|
||||
+2
@@ -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)
|
||||
|
||||
+15
-16
@@ -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<EnqueueTTSRequest>,
|
||||
server_state: web::Data<Arc<ServerState>>) -> Result<HttpResponse,EnqueueTTSRequestError> {
|
||||
|
||||
println!("Recieved payload");
|
||||
let is_debug_request = true;
|
||||
let mut maybe_user_token : Option<UserToken> = None;
|
||||
let maybe_user_token : Option<UserToken> = 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")
|
||||
|
||||
Reference in new issue
Block a user