mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-06 10:11:31 +00:00
populate "new token"
This commit is contained in:
1 parent
169b45413d
commit
b2555bc756
6 files changed
+11
-12
No files matched your search
@@ -44,6 +44,7 @@ async fn create_rvc_model(
|
||||
|
||||
insert_voice_conversion_model_from_download_job(InsertVoiceConversionModelArgs {
|
||||
model_type: VoiceConversionModelType::RvcV2,
|
||||
maybe_new_weights_token: None,
|
||||
title,
|
||||
original_download_url: "https://example.com",
|
||||
original_filename: "unknown.zip",
|
||||
|
||||
+7
-2
@@ -6,12 +6,15 @@ use sqlx::MySqlPool;
|
||||
use enums::by_table::voice_conversion_models::voice_conversion_model_type::VoiceConversionModelType;
|
||||
use enums::common::visibility::Visibility;
|
||||
use errors::AnyhowResult;
|
||||
use tokens::tokens::model_weights::ModelWeightToken;
|
||||
use tokens::tokens::users::UserToken;
|
||||
use tokens::tokens::voice_conversion_models::VoiceConversionModelToken;
|
||||
|
||||
pub struct InsertVoiceConversionModelArgs<'a, P: AsRef<Path>> {
|
||||
pub model_type: VoiceConversionModelType,
|
||||
|
||||
pub maybe_new_weights_token: Option<&'a ModelWeightToken>,
|
||||
|
||||
pub title: &'a str,
|
||||
|
||||
pub original_download_url: &'a str,
|
||||
@@ -60,7 +63,8 @@ SET
|
||||
has_index_file = ?,
|
||||
private_bucket_hash = ?,
|
||||
private_bucket_object_name = ?,
|
||||
file_size_bytes = ?
|
||||
file_size_bytes = ?,
|
||||
maybe_migration_new_model_weights_token = ?
|
||||
"#,
|
||||
&model_token,
|
||||
args.model_type.to_str(),
|
||||
@@ -72,7 +76,8 @@ SET
|
||||
args.has_index_file,
|
||||
args.private_bucket_hash,
|
||||
private_bucket_object_name,
|
||||
args.file_size_bytes
|
||||
args.file_size_bytes,
|
||||
args.maybe_new_weights_token,
|
||||
)
|
||||
.execute(args.mysql_pool)
|
||||
.await;
|
||||
|
||||
-10
@@ -29,11 +29,6 @@ pub struct VoiceConversionModelRecordForList {
|
||||
|
||||
pub is_front_page_featured: bool,
|
||||
|
||||
// TODO(bt, 2023-04-18): Need columns for ratings
|
||||
//pub user_ratings_positive_count: u32,
|
||||
//pub user_ratings_negative_count: u32,
|
||||
//pub user_ratings_total_count: u32, // NB: Does not include "neutral" ratings.
|
||||
|
||||
pub creator_set_visibility: Visibility,
|
||||
|
||||
pub created_at: DateTime<Utc>,
|
||||
@@ -183,11 +178,6 @@ struct RawVoiceConversionModelRecord {
|
||||
|
||||
pub is_front_page_featured: i8, // bool
|
||||
|
||||
// TODO(bt, 2023-04-18): Need columns for ratings
|
||||
//pub user_ratings_positive_count: u32,
|
||||
//pub user_ratings_negative_count: u32,
|
||||
//pub user_ratings_total_count: u32, // NB: Does not include "neutral" ratings.
|
||||
|
||||
pub creator_set_visibility: Visibility,
|
||||
|
||||
pub created_at: DateTime<Utc>,
|
||||
|
||||
+1
@@ -164,6 +164,7 @@ pub async fn process_rvc_v2_model<'a, 'b>(
|
||||
|
||||
let (_id, voice_conversion_model_token) = insert_voice_conversion_model_from_download_job(InsertVoiceConversionModelArgs {
|
||||
model_type: VoiceConversionModelType::RvcV2,
|
||||
maybe_new_weights_token: Some(&model_weights_token),
|
||||
title: &job.title,
|
||||
original_download_url: &job.download_url,
|
||||
original_filename: &download_filename,
|
||||
|
||||
+1
@@ -109,6 +109,7 @@ pub async fn process_so_vits_svc_model<'a, 'b>(
|
||||
|
||||
let (_id, voice_conversion_model_token) = insert_voice_conversion_model_from_download_job(InsertVoiceConversionModelArgs {
|
||||
model_type: VoiceConversionModelType::SoVitsSvc,
|
||||
maybe_new_weights_token: Some(&model_weights_token),
|
||||
title: &job.title,
|
||||
original_download_url: &job.download_url,
|
||||
original_filename: &download_filename,
|
||||
|
||||
+1
@@ -100,6 +100,7 @@ pub async fn process_softvc_model<'a, 'b>(
|
||||
|
||||
let (_id, model_token) = insert_voice_conversion_model_from_download_job(InsertVoiceConversionModelArgs {
|
||||
model_type: VoiceConversionModelType::SoftVc,
|
||||
maybe_new_weights_token: None,
|
||||
title: &job.title,
|
||||
original_download_url: &job.download_url,
|
||||
original_filename: &download_filename,
|
||||
|
||||
Reference in new issue
Block a user