From 168afd72cd5c25f0158028f117381a4579452484 Mon Sep 17 00:00:00 2001 From: ArEnSc Date: Sat, 27 Jan 2024 01:29:57 -0500 Subject: [PATCH] Fixed GDrive download check. --- .../job_types/image_generation/sd/process_job.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/service/job/inference_job/src/job/job_types/image_generation/sd/process_job.rs b/crates/service/job/inference_job/src/job/job_types/image_generation/sd/process_job.rs index cb0a4118fc..072b4884fa 100644 --- a/crates/service/job/inference_job/src/job/job_types/image_generation/sd/process_job.rs +++ b/crates/service/job/inference_job/src/job/job_types/image_generation/sd/process_job.rs @@ -210,7 +210,15 @@ pub async fn process_job_sd( return Err(ProcessSingleJobError::from_anyhow_error(anyhow!("Failed to Download"))); } }; + let download_file_path = work_temp_dir.path().join(download_filename); + + if file_exists(download_file_path.as_path()) == false { + return Err( + ProcessSingleJobError::from_anyhow_error(anyhow!("Failed to Download SD Model from Google")) + ); + } + info!("File Retrieved at {}", download_file_path.display()); // download vae for model @@ -408,6 +416,12 @@ pub async fn process_job_lora( let download_file_path = work_temp_dir.path().join(download_filename); info!("File Retrieved at {}", download_file_path.display()); + if file_exists(download_file_path.as_path()) == false { + return Err( + ProcessSingleJobError::from_anyhow_error(anyhow!("Failed to Download loRA Model from Google Drive")) + ); + } + // download model + vae for lora // use lora with whatever checkpoint make it fixed id if it works submit it