mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-02 16:38:14 +00:00
Testing
This commit is contained in:
1 parent
5ba8d876f0
commit
7e169e3b51
2 files changed
+12
-22
No files matched your search
@@ -41,14 +41,14 @@ pub async fn test_seed_weights_files() -> AnyhowResult<()> {
|
||||
|
||||
let bucket_details1 = RemoteCloudBucketDetails {
|
||||
object_hash: String::from("apa0ej6es8d3ss2gwtf1cghge35qn9tn"),
|
||||
prefix: String::from("sd15"),
|
||||
suffix: String::from("safetensors"),
|
||||
prefix: String::from("sd15_"),
|
||||
suffix: String::from(".safetensors"),
|
||||
};
|
||||
|
||||
let bucket_details2 = RemoteCloudBucketDetails {
|
||||
object_hash: String::from("27kz11et18fargyyxbj66ntfn621k9d3"),
|
||||
prefix: String::from("loRA"),
|
||||
suffix: String::from("safetensors"),
|
||||
prefix: String::from("loRA_"),
|
||||
suffix: String::from(".safetensors"),
|
||||
};
|
||||
|
||||
remote_cloud_file_client.download_file(bucket_details1, String::from("./checkpoint")).await?;
|
||||
@@ -331,10 +331,6 @@ pub async fn seed_weights_for_paging(mysql_pool: &Pool<MySql>, user_token: UserT
|
||||
// private_bucket_hash = format!("bucket_hash{}", i);
|
||||
private_bucket_prefix = format!("_fake");
|
||||
private_bucket_extension = format!("rvcV2");
|
||||
//cached_user_ratings_total_count = i;
|
||||
//cached_user_ratings_positive_count = i;
|
||||
//cached_user_ratings_negative_count = i;
|
||||
//cached_user_ratings_ratio = i as u32 / 100;
|
||||
version = i as i32;
|
||||
|
||||
println!("Out of range");
|
||||
@@ -836,8 +832,8 @@ pub async fn seed_weights_for_user_token(
|
||||
file_size_bytes: 1024,
|
||||
file_checksum_sha2: "checksum1".to_string(),
|
||||
public_bucket_hash: "bucket_hash1".to_string(),
|
||||
maybe_public_bucket_prefix: Some("_fake".to_string()),
|
||||
maybe_public_bucket_extension: Some("rvc".to_string()),
|
||||
maybe_public_bucket_prefix: Some("rvc_".to_string()),
|
||||
maybe_public_bucket_extension: Some(".pt".to_string()),
|
||||
//cached_user_ratings_total_count: 10,
|
||||
//cached_user_ratings_positive_count: 9,
|
||||
//cached_user_ratings_negative_count: 1,
|
||||
@@ -1119,9 +1115,9 @@ pub async fn seed_weights(mysql_pool: &Pool<MySql>) -> AnyhowResult<()> {
|
||||
// original_seed_weights(mysql_pool,user_token).await?;
|
||||
// seed_weights_for_user_token(mysql_pool, user_token).await?;
|
||||
// seed_weights_for_paging(mysql_pool,user_token).await?;
|
||||
// seed_weights_for_testing_inference(mysql_pool,user_token.clone()).await?;
|
||||
seed_weights_for_testing_inference(mysql_pool,user_token.clone()).await?;
|
||||
// println!("TESTING DOWLOAD");
|
||||
// test_seed_weights_files().await?;
|
||||
seed_workflows_for_testing_inference(mysql_pool,user_token.clone()).await?;
|
||||
//test_seed_weights_files().await?;
|
||||
// seed_workflows_for_testing_inference(mysql_pool,user_token.clone()).await?;
|
||||
Ok(())
|
||||
}
|
||||
+3
-9
@@ -44,9 +44,6 @@ use crate::job::job_loop::process_single_job_error::ProcessSingleJobError;
|
||||
use crate::job::job_types::image_generation::sd::sd_inference_command::InferenceArgs;
|
||||
use crate::job_dependencies::JobDependencies;
|
||||
|
||||
const SD_IMAGE_PREFIX : &str = "image_";
|
||||
const SD_IMAGE_SUFFIX : &str = ".png";
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)]
|
||||
pub struct InferenceValues {
|
||||
pub prompt: String,
|
||||
@@ -294,7 +291,6 @@ pub async fn process_job_sd(
|
||||
return Err(error);
|
||||
}
|
||||
|
||||
|
||||
// check if file exists if it does not error out....
|
||||
let path = output_path.clone();
|
||||
let file_path = format!("{}_{}.png", path_to_string(path), 0);
|
||||
@@ -321,7 +317,7 @@ pub async fn process_job_sd(
|
||||
}
|
||||
};
|
||||
|
||||
let model_weight_token = &ModelWeightToken::generate();
|
||||
let model_weight_token: &ModelWeightToken = &ModelWeightToken::generate();
|
||||
let model_weight_token_result = create_weight(CreateModelWeightsArgs {
|
||||
token: &model_weight_token,
|
||||
weights_type: WeightsType::StableDiffusion15,
|
||||
@@ -934,10 +930,8 @@ pub async fn process_job_inference(
|
||||
maybe_frame_height: Some(sd_args.maybe_height.unwrap_or(512)),
|
||||
checksum_sha2: metadata.sha256_checksum.as_str(),
|
||||
public_bucket_directory_hash: bucket_details.object_hash.as_str(),
|
||||
//maybe_public_bucket_prefix: Some(bucket_details.prefix.as_str()),
|
||||
maybe_public_bucket_prefix: Some(SD_IMAGE_PREFIX),
|
||||
//maybe_public_bucket_extension: Some(bucket_details.suffix.as_str()),
|
||||
maybe_public_bucket_extension: Some(SD_IMAGE_SUFFIX),
|
||||
maybe_public_bucket_prefix: Some(bucket_details.prefix.as_str()),
|
||||
maybe_public_bucket_extension: Some(bucket_details.suffix.as_str()),
|
||||
extra_file_modification_info: Some(&inputs),
|
||||
maybe_creator_file_synthetic_id_category: IdCategory::MediaFile,
|
||||
maybe_creator_category_synthetic_id_category: IdCategory::ModelWeights,
|
||||
|
||||
Reference in new issue
Block a user