complete failure

This commit is contained in:
salt committed 2023-12-12 17:35:36 -08:00
1 parent 14432cce83
commit d51ee67d4c
5 files changed
+25 -34

No files matched your search

@@ -50,6 +50,7 @@ impl InferenceCategory {
"lipsync_animation" => Ok(Self::LipsyncAnimation),
"text_to_speech" => Ok(Self::TextToSpeech),
"voice_conversion" => Ok(Self::VoiceConversion),
"rerender_a_video" => Ok(Self::RerenderAVideo),
_ => Err(format!("invalid value: {:?}", value)),
}
}
@@ -61,6 +62,7 @@ impl InferenceCategory {
Self::LipsyncAnimation,
Self::TextToSpeech,
Self::VoiceConversion,
Self::RerenderAVideo,
])
}
}
@@ -75,6 +77,7 @@ mod tests {
assert_serialization(InferenceCategory::LipsyncAnimation, "lipsync_animation");
assert_serialization(InferenceCategory::TextToSpeech, "text_to_speech");
assert_serialization(InferenceCategory::VoiceConversion, "voice_conversion");
assert_serialization(InferenceCategory::RerenderAVideo, "rerender_a_video");
}
#[test]
@@ -82,6 +85,7 @@ mod tests {
assert_eq!(InferenceCategory::LipsyncAnimation.to_str(), "lipsync_animation");
assert_eq!(InferenceCategory::TextToSpeech.to_str(), "text_to_speech");
assert_eq!(InferenceCategory::VoiceConversion.to_str(), "voice_conversion");
assert_eq!(InferenceCategory::RerenderAVideo.to_str(), "rerender_a_video");
}
#[test]
@@ -89,16 +93,18 @@ mod tests {
assert_eq!(InferenceCategory::from_str("lipsync_animation").unwrap(), InferenceCategory::LipsyncAnimation);
assert_eq!(InferenceCategory::from_str("text_to_speech").unwrap(), InferenceCategory::TextToSpeech);
assert_eq!(InferenceCategory::from_str("voice_conversion").unwrap(), InferenceCategory::VoiceConversion);
assert_eq!(InferenceCategory::from_str("rerender_a_video").unwrap(), InferenceCategory::RerenderAVideo);
}
#[test]
fn all_variants() {
// Static check
let mut variants = InferenceCategory::all_variants();
assert_eq!(variants.len(), 3);
assert_eq!(variants.len(), 4);
assert_eq!(variants.pop_first(), Some(InferenceCategory::LipsyncAnimation));
assert_eq!(variants.pop_first(), Some(InferenceCategory::TextToSpeech));
assert_eq!(variants.pop_first(), Some(InferenceCategory::VoiceConversion));
assert_eq!(variants.pop_first(), Some(InferenceCategory::RerenderAVideo));
assert_eq!(variants.pop_first(), None);
// Generated check
@@ -49,7 +49,7 @@ impl InferenceModelType {
Self::Tacotron2 => "tacotron2",
Self::Vits => "vits",
Self::VallEX => "vall_e_x",
Self::RerenderAVideo => "rerender_a_video",
Self::RerenderAVideo => "rerender_a_video",
}
}
@@ -61,6 +61,7 @@ impl InferenceModelType {
"tacotron2" => Ok(Self::Tacotron2),
"vits" => Ok(Self::Vits),
"vall_e_x" => Ok(Self::VallEX),
"rerender_a_video" => Ok(Self::RerenderAVideo),
_ => Err(format!("invalid value: {:?}", value)),
}
}
@@ -74,7 +75,8 @@ impl InferenceModelType {
InferenceModelType::SoVitsSvc,
InferenceModelType::Tacotron2,
InferenceModelType::Vits,
InferenceModelType::VallEX
InferenceModelType::VallEX,
InferenceModelType::RerenderAVideo
])
}
}
@@ -94,6 +94,15 @@ VITS_INFERENCE_SCRIPT="infer_ts_job.py"
VITS_INFERENCE_MAYBE_PYTHON_INTERPRETER="python3"
VITS_INFERENCE_MAYBE_DOCKER_IMAGE_SHA="03017896367b"
# ================================= #
# #
# Rerender #
# #
# ================================= #
RERENDER_INFERENCE_ROOT_DIRECTORY="/home/salt/clone/storyteller-ml/animation/rerender-lora/"
RERENDER_INFERENCE_EXECUTABLE_OR_COMMAND="conda activate rerender && python rerender.py"
# ================================= #
# #
# CACHE SETTINGS #
@@ -40,7 +40,7 @@ pub struct RerenderInferenceCommand {
executable_or_command: ExecutableOrCommand,
/// Config file to use
config_path: PathBuf,
config_path: Option<PathBuf>,
/// eg. `source python/bin/activate`
maybe_virtual_env_activation_command: Option<String>,
@@ -68,30 +68,12 @@ pub struct InferenceArgs<'s, P: AsRef<Path>> {
}
impl RerenderInferenceCommand {
pub fn new<P: AsRef<Path>>(
rerender_root_code_directory: PathBuf,
executable_or_command: ExecutableOrCommand,
config_path: PathBuf,
maybe_virtual_env_activation_command: Option<String>,
maybe_docker_options: Option<DockerOptions>,
maybe_execution_timeout: Option<Duration>,
) -> Self {
Self {
rerender_root_code_directory: rerender_root_code_directory.clone(),
executable_or_command,
config_path: config_path.clone(),
maybe_virtual_env_activation_command: maybe_virtual_env_activation_command.map(|s| s.to_string()),
maybe_docker_options,
maybe_execution_timeout,
}
}
pub fn from_env() -> AnyhowResult<Self> {
let rerender_root_code_directory = easyenv::get_env_pathbuf_required(
"RERENDER_INFERENCE_ROOT_DIRECTORY")?;
let config_path = easyenv::get_env_pathbuf_required(
"RERENDER_INFERENCE_CONFIG_PATH")?;
let config_path = easyenv::get_env_pathbuf_optional(
"RERENDER_INFERENCE_CONFIG_PATH");
let executable_or_command = match easyenv::get_env_string_optional(
"RERENDER_INFERENCE_EXECUTABLE_OR_COMMAND") {
@@ -20,7 +20,6 @@ use mysql_queries::payloads::generic_inference_args::videofilter_payload::{Reren
use mysql_queries::queries::generic_inference::web::insert_generic_inference_job::{insert_generic_inference_job, InsertGenericInferenceArgs};
use tokens::tokens::generic_inference_jobs::InferenceJobToken;
use tokens::tokens::media_files::MediaFileToken;
use tokens::tokens::media_uploads::MediaUploadToken;
use tokens::tokens::users::UserToken;
use crate::configs::plans::get_correct_plan_for_session::get_correct_plan_for_session;
@@ -39,17 +38,12 @@ const ROUTING_TAG_HEADER_NAME : &str = "routing-tag";
pub struct EnqueueRerenderAnimationRequest {
uuid_idempotency_token: String,
video_source: VideoSource,
video_source: Option<MediaFileToken>,
sd_model: String,
creator_set_visibility: Option<Visibility>,
}
/// Treated as an enum. Only one of these may be set.
#[derive(Deserialize)]
pub struct VideoSource {
maybe_media_file_token: Option<MediaFileToken>,
maybe_media_upload_token: Option<MediaUploadToken>,
}
#[derive(Serialize)]
pub struct EnqueueRerenderAnimationSuccessResponse {
@@ -165,10 +159,8 @@ pub async fn enqueue_rerender_animation_handler(
// TODO(bt): CHECK DATABASE FOR TOKENS!
let video_source: VideofilterVideoSource = {
if let Some(ref token) = request.video_source.maybe_media_file_token {
if let Some(ref token) = request.video_source {
VideofilterVideoSource::media_file_token(token.as_str())
} else if let Some(ref token) = request.video_source.maybe_media_upload_token {
VideofilterVideoSource::media_upload_token(token.as_str())
} else {
return Err(EnqueueRerenderAnimationError::BadInput("video source not fully specified".to_string()));
}