mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-03 08:57:54 +00:00
cleanup
This commit is contained in:
1 parent
530d891ce9
commit
b8442b54ee
12 files changed
+29
-32
No files matched your search
@@ -4,7 +4,7 @@ use errors::AnyhowResult;
|
||||
use jobs_common::noop_logger::NoOpLogger;
|
||||
use log::{error, info, warn};
|
||||
use std::time::Duration;
|
||||
use crate::job::job_steps::job_dependencies::JobDependencies;
|
||||
use crate::job_dependencies::JobDependencies;
|
||||
use crate::job::job_steps::process_single_job::process_single_job;
|
||||
|
||||
// Job runner timeouts (guards MySQL)
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
pub mod job_dependencies;
|
||||
pub mod job_stats;
|
||||
pub mod main_loop;
|
||||
pub mod process_single_job;
|
||||
pub mod process_single_job_error;
|
||||
pub mod select_job_batch;
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::job::job_steps::job_dependencies::JobDependencies;
|
||||
use crate::job_dependencies::JobDependencies;
|
||||
use crate::job::job_types::tts::process_single_tts_job::process_single_tts_job;
|
||||
use crate::job::job_types::vc::process_single_vc_job::process_single_vc_job;
|
||||
use enums::workers::generic_inference_type::GenericInferenceType;
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
use mysql_queries::queries::generic_inference::job::list_available_generic_inference_jobs::{list_available_generic_inference_jobs, ListAvailableGenericInferenceJobArgs};
|
||||
use enums::workers::generic_inference_type::GenericInferenceType;
|
||||
use sqlx::MySqlPool;
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
pub struct SelectJobBatchArgs <'a> {
|
||||
pub num_records: u32,
|
||||
pub is_debug_worker: bool,
|
||||
pub sort_by_priority: bool,
|
||||
pub maybe_scope_by_job_type: Option<BTreeSet<GenericInferenceType>>,
|
||||
pub mysql_pool: &'a MySqlPool,
|
||||
}
|
||||
|
||||
pub async fn select_job_batch(args: SelectJobBatchArgs<'_>) {
|
||||
let _results = list_available_generic_inference_jobs(ListAvailableGenericInferenceJobArgs {
|
||||
num_records: args.num_records,
|
||||
is_debug_worker: args.is_debug_worker,
|
||||
sort_by_priority: args.sort_by_priority,
|
||||
maybe_scope_by_job_type: args.maybe_scope_by_job_type,
|
||||
mysql_pool: args.mysql_pool,
|
||||
}).await;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
use anyhow::anyhow;
|
||||
use crate::job::job_steps::job_dependencies::JobDependencies;
|
||||
use crate::job_dependencies::JobDependencies;
|
||||
use errors::AnyhowResult;
|
||||
use mysql_queries::column_types::tts_model_type::TtsModelType;
|
||||
use mysql_queries::queries::generic_inference::job::list_available_generic_inference_jobs::AvailableInferenceJob;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
use mysql_queries::queries::generic_inference::job::list_available_generic_inference_jobs::AvailableInferenceJob;
|
||||
use errors::AnyhowResult;
|
||||
use crate::job::job_steps::job_dependencies::JobDependencies;
|
||||
use crate::job_dependencies::JobDependencies;
|
||||
|
||||
pub async fn handle_tts_inference(
|
||||
_job_dependencies: &JobDependencies,
|
||||
|
||||
+22
-1
@@ -1,8 +1,29 @@
|
||||
use crate::job::job_steps::job_dependencies::JobDependencies;
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
use std::path::PathBuf;
|
||||
use crate::job_dependencies::JobDependencies;
|
||||
use errors::AnyhowResult;
|
||||
use mysql_queries::queries::generic_inference::job::list_available_generic_inference_jobs::AvailableInferenceJob;
|
||||
use mysql_queries::queries::tts::tts_models::get_tts_model_for_inference_improved::TtsModelForInferenceRecord;
|
||||
|
||||
/// Text starting with this will be treated as a test request.
|
||||
/// This allows the request to bypass the model cache and query the latest TTS model.
|
||||
const TEST_REQUEST_TEXT: &'static str = "This is a test request.";
|
||||
|
||||
#[derive(Deserialize, Default)]
|
||||
struct FileMetadata {
|
||||
pub duration_millis: Option<u64>,
|
||||
pub mimetype: Option<String>,
|
||||
pub file_size_bytes: u64,
|
||||
}
|
||||
|
||||
fn read_metadata_file(filename: &PathBuf) -> AnyhowResult<FileMetadata> {
|
||||
let mut file = File::open(filename)?;
|
||||
let mut buffer = String::new();
|
||||
file.read_to_string(&mut buffer)?;
|
||||
Ok(serde_json::from_str(&buffer)?)
|
||||
}
|
||||
|
||||
pub async fn process_job(job_dependencies: &JobDependencies, job: &AvailableInferenceJob, tts_model: &TtsModelForInferenceRecord) -> AnyhowResult<()> {
|
||||
|
||||
Ok(())
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use errors::AnyhowResult;
|
||||
use mysql_queries::queries::generic_inference::job::list_available_generic_inference_jobs::AvailableInferenceJob;
|
||||
use crate::job::job_steps::job_dependencies::JobDependencies;
|
||||
use crate::job_dependencies::JobDependencies;
|
||||
|
||||
pub async fn process_single_vc_job(job_dependencies: &JobDependencies, job: &AvailableInferenceJob) -> AnyhowResult<()> {
|
||||
Ok(())
|
||||
|
||||
File renamed without changes.
@@ -17,6 +17,7 @@
|
||||
|
||||
pub mod job;
|
||||
pub mod util;
|
||||
pub mod job_dependencies;
|
||||
|
||||
use clap::{App, Arg};
|
||||
use cloud_storage::bucket_client::BucketClient;
|
||||
@@ -26,10 +27,10 @@ use config::shared_constants::DEFAULT_MYSQL_CONNECTION_STRING;
|
||||
use config::shared_constants::DEFAULT_RUST_LOG;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use container_common::filesystem::check_directory_exists::check_directory_exists;
|
||||
use crate::job::job_steps::job_dependencies::{JobCaches, JobDependencies, JobWorkerDetails};
|
||||
use crate::job::job_steps::job_stats::JobStats;
|
||||
use crate::job::job_steps::main_loop::main_loop;
|
||||
use crate::job::job_types::tts::tacotron2_v2_early_fakeyou::tacotron_inference_command::TacotronInferenceCommand;
|
||||
use crate::job_dependencies::{JobCaches, JobDependencies, JobWorkerDetails};
|
||||
use crate::util::scoped_temp_dir_creator::ScopedTempDirCreator;
|
||||
use jobs_common::job_progress_reporter::job_progress_reporter::JobProgressReporterBuilder;
|
||||
use jobs_common::job_progress_reporter::noop_job_progress_reporter::NoOpJobProgressReporterBuilder;
|
||||
|
||||
File renamed without changes.
Reference in new issue
Block a user