mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-15 22:32:13 +00:00
Seed voice conversion models
This commit is contained in:
1 parent
39de5aba13
commit
018b05a3a2
4 files changed
+63
-1
No files matched your search
@@ -5,6 +5,7 @@ use config::shared_constants::{DEFAULT_MYSQL_CONNECTION_STRING, DEFAULT_RUST_LOG
|
||||
use errors::AnyhowResult;
|
||||
|
||||
use crate::seeding::users::seed_user_accounts;
|
||||
use crate::seeding::voice_conversion::seed_voice_conversion;
|
||||
use crate::seeding::zero_shot_tts::seed_zero_shot_tts;
|
||||
|
||||
pub mod seeding;
|
||||
@@ -27,6 +28,7 @@ pub async fn main() -> AnyhowResult<()> {
|
||||
|
||||
seed_user_accounts(&pool).await?;
|
||||
seed_zero_shot_tts(&pool).await?;
|
||||
seed_voice_conversion(&pool).await?;
|
||||
|
||||
info!("Done!");
|
||||
Ok(())
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
pub mod users;
|
||||
pub mod voice_conversion;
|
||||
pub mod zero_shot_tts;
|
||||
@@ -0,0 +1,59 @@
|
||||
use log::info;
|
||||
use sqlx::{MySql, Pool};
|
||||
|
||||
use enums::by_table::voice_conversion_models::voice_conversion_model_type::VoiceConversionModelType;
|
||||
use errors::{anyhow, AnyhowResult};
|
||||
use mysql_queries::queries::users::user::get_user_token_by_username::get_user_token_by_username;
|
||||
use mysql_queries::queries::voice_conversion::models::insert_voice_conversion_model_from_download_job::{insert_voice_conversion_model_from_download_job, InsertVoiceConversionModelArgs};
|
||||
use tokens::users::user::UserToken;
|
||||
|
||||
use crate::seeding::users::HANASHI_USERNAME;
|
||||
|
||||
pub async fn seed_voice_conversion(mysql_pool: &Pool<MySql>) -> AnyhowResult<()> {
|
||||
info!("Seeding voice conversion...");
|
||||
|
||||
let user_token = match get_user_token_by_username(HANASHI_USERNAME, mysql_pool).await? {
|
||||
None => { return Err(anyhow!("could not find user hanashi")) }
|
||||
Some(token) => token,
|
||||
};
|
||||
|
||||
let rvc_models = [
|
||||
("Eric Cartman", "4t9d3y4ve807q69t806pw352dx82h83dzf52bfrp9s9z63gqsxgyezxf8fzdn9yn", true),
|
||||
("Stewie", "bvfe3zwvqnrv64rrtvva1f3r2p2k5tpznfejbh90r353brzqfkveytzyt4cy73hs", true),
|
||||
("Yoda", "cqbcbjsbdy77s4g525nrs791s035b13wew7rp6pep49sx0xr8pqr5af5sseqtkq7", false),
|
||||
];
|
||||
|
||||
for (title, private_bucket_hash, has_index_file) in rvc_models {
|
||||
create_rvc_model(title, private_bucket_hash, has_index_file, &user_token, mysql_pool).await?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn create_rvc_model(
|
||||
title: &str,
|
||||
private_bucket_hash: &str,
|
||||
has_index_file: bool,
|
||||
creator_user_token: &UserToken,
|
||||
mysql_pool: &Pool<MySql>,
|
||||
) -> AnyhowResult<()> {
|
||||
|
||||
info!("Creating voice conversion record");
|
||||
|
||||
insert_voice_conversion_model_from_download_job(InsertVoiceConversionModelArgs {
|
||||
model_type: VoiceConversionModelType::RvcV2,
|
||||
title,
|
||||
original_download_url: "https://example.com",
|
||||
original_filename: "unknown.zip",
|
||||
file_size_bytes: 1234,
|
||||
creator_user_token: creator_user_token.as_str(),
|
||||
creator_ip_address: "127.0.0.1",
|
||||
creator_set_visibility: Default::default(),
|
||||
has_index_file,
|
||||
private_bucket_hash,
|
||||
private_bucket_object_name: "unused",
|
||||
mysql_pool,
|
||||
}).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -9,7 +9,7 @@ BUCKET_TIMEOUT_SECONDS=1200
|
||||
|
||||
WEB_DOWNLOADER_COMMAND=./download_internet_file.py
|
||||
WEB_DOWNLOADER_MAYBE_VENV_SCRIPT=./python/bin/activate
|
||||
WEB_DOWNLOADER_MAYBE_DOCKER_IMAGE=4258e0b8bb0f
|
||||
WEB_DOWNLOADER_MAYBE_DOCKER_IMAGE=d0c49bc35097
|
||||
#WEB_DOWNLOADER_MAYBE_DOCKER_IMAGE=d73f28ce3ff6
|
||||
#WEB_DOWNLOADER_MAYBE_DOCKER_IMAGE=3fcadd002b0a
|
||||
|
||||
|
||||
Reference in new issue
Block a user