mirror of
https://github.com/storytold/artcraft.git
synced 2026-10-27 12:10:08 -04:00
Compare commits
48
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25b90c07ce | ||
|
|
2f971dda60 | ||
|
|
b30c352d79 | ||
|
|
cb2d36401c | ||
|
|
7dea4c64fa | ||
|
|
9ab8e52211 | ||
|
|
81dd377599 | ||
|
|
e641f26d21 | ||
|
|
3766758cfb | ||
|
|
196be25fb5 | ||
|
|
57e2f70707 | ||
|
|
292b831d16 | ||
|
|
d51ee67d4c | ||
|
|
e375c8090c | ||
|
|
e5a85c7528 | ||
|
|
14432cce83 | ||
|
|
43030402ca | ||
|
|
2d59c5c573 | ||
|
|
18309385b4 | ||
|
|
f9ff9b8c9f | ||
|
|
d22d64fac7 | ||
|
|
08d8e5279e | ||
|
|
d9fe4e56a0 | ||
|
|
dcf6451693 | ||
|
|
dbe3d5e977 | ||
|
|
07750fa122 | ||
|
|
795eb7a141 | ||
|
|
d49b01930e | ||
|
|
052e4bfbd8 | ||
|
|
30d6bca9b2 | ||
|
|
94d62736ad | ||
|
|
1cde23c080 | ||
|
|
d3be9a3a6b | ||
|
|
c09adc3729 | ||
|
|
e78cdf85e3 | ||
|
|
5971d95a80 | ||
|
|
602de6d736 | ||
|
|
de8eb05db6 | ||
|
|
996f8ce05b | ||
|
|
b4afec5c26 | ||
|
|
ab1f81036f | ||
|
|
4a806e7d67 | ||
|
|
c811296bdc | ||
|
|
6033289a36 | ||
|
|
90ec14b8d0 | ||
|
|
e18b86a55a | ||
|
|
d39962491f | ||
|
|
6c320dd329 |
@@ -75,4 +75,5 @@ TTS_HIFIGAN_SUPERRES_VOCODER_MODEL_FILENAME=hifigan_superres_twilight_33000.pt
|
||||
|
||||
# Development key. Permissible to check in.
|
||||
NEWRELIC_API_KEY=c402be1c4c4216ec83d0cfc0851520cfFFFFNRAL
|
||||
STORYTELLER_ROOT="/home/tensor/code/storyteller/"
|
||||
|
||||
#STORYTELLER_ROOT="/home/tensor/code/storyteller/" # Put this in .env-secrets so that not everyone gets this setting.
|
||||
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nSELECT\n f.token as `token: tokens::tokens::favorites::FavoriteToken`,\n\n f.entity_type as `entity_type: enums::by_table::favorites::favorite_entity_type::FavoriteEntityType`,\n f.entity_token,\n\n f.user_token as `user_token: tokens::tokens::users::UserToken`,\n u.username,\n u.display_name as user_display_name,\n u.email_gravatar_hash as user_gravatar_hash,\n\n f.created_at,\n f.updated_at,\n f.deleted_at\n\nFROM\n favorites AS f\nJOIN users AS u\n ON f.user_token = u.token\nWHERE\n f.token = ?\n ",
|
||||
"query": "\nSELECT\n f.token as `token: tokens::tokens::user_bookmarks::UserBookmarkToken`,\n\n f.entity_type as `entity_type: enums::by_table::user_bookmarks::user_bookmark_entity_type::UserBookmarkEntityType`,\n f.entity_token,\n\n f.user_token as `user_token: tokens::tokens::users::UserToken`,\n u.username,\n u.display_name as user_display_name,\n u.email_gravatar_hash as user_gravatar_hash,\n\n f.created_at,\n f.updated_at,\n f.deleted_at\n\nFROM\n user_bookmarks AS f\nJOIN users AS u\n ON f.user_token = u.token\nWHERE\n f.token = ?\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "token: tokens::tokens::favorites::FavoriteToken",
|
||||
"name": "token: tokens::tokens::user_bookmarks::UserBookmarkToken",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
|
||||
@@ -15,7 +15,7 @@
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "entity_type: enums::by_table::favorites::favorite_entity_type::FavoriteEntityType",
|
||||
"name": "entity_type: enums::by_table::user_bookmarks::user_bookmark_entity_type::UserBookmarkEntityType",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
|
||||
@@ -120,5 +120,5 @@
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "f1ef63978793e7da5bd5e1a486254dd436db8021c8f049efa41f43cf7ce75f1d"
|
||||
"hash": "02136088e16742de2154cd9e84eeebbdb76045ad26aeb1c517a54c296bf31087"
|
||||
}
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nINSERT INTO media_files\nSET\n token = ?,\n\n origin_category = ?,\n origin_product_category = ?,\n\n media_type = ?,\n maybe_mime_type = ?,\n file_size_bytes = ?,\n checksum_sha2 = ?,\n\n public_bucket_directory_hash = ?,\n maybe_public_bucket_prefix = ?,\n maybe_public_bucket_extension = ?,\n\n maybe_creator_user_token = ?,\n creator_ip_address = ?,\n\n creator_set_visibility = ?\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 13
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "030e26fa7977555cdd04864d9b95c07196ab520cd8c63d30689b6021fa4b4ec1"
|
||||
}
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nSELECT\n f.token as `token: tokens::tokens::favorites::FavoriteToken`,\n f.user_token as `user_token: tokens::tokens::users::UserToken`,\n u.username,\n u.display_name as user_display_name,\n u.email_gravatar_hash as user_gravatar_hash,\n\n f.created_at,\n f.updated_at,\n f.deleted_at\n\nFROM\n favorites AS f\nJOIN users AS u\n ON f.user_token = u.token\nWHERE\n f.entity_type = ?\n AND f.entity_token = ?\n AND f.deleted_at IS NULL\nORDER BY f.id DESC\nLIMIT 50\n ",
|
||||
"query": "\nSELECT\n f.token as `token: tokens::tokens::user_bookmarks::UserBookmarkToken`,\n f.user_token as `user_token: tokens::tokens::users::UserToken`,\n u.username,\n u.display_name as user_display_name,\n u.email_gravatar_hash as user_gravatar_hash,\n\n f.created_at,\n f.updated_at,\n f.deleted_at\n\nFROM\n user_bookmarks AS f\nJOIN users AS u\n ON f.user_token = u.token\nWHERE\n f.entity_type = ?\n AND f.entity_token = ?\n AND f.deleted_at IS NULL\nORDER BY f.id DESC\nLIMIT 50\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "token: tokens::tokens::favorites::FavoriteToken",
|
||||
"name": "token: tokens::tokens::user_bookmarks::UserBookmarkToken",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
|
||||
@@ -98,5 +98,5 @@
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "99cff649bf75f5b05330e7db8536ecc832affbae7c9710e158099079609e5e16"
|
||||
"hash": "1c1ef2195e81362d0eb023ede236c6fa65ede80d9efcaa4996694ce32c12cc0c"
|
||||
}
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\n UPDATE model_weights\n SET\n title = ?,\n description_markdown = ?,\n maybe_thumbnail_token = ?,\n description_rendered_html = ?,\n creator_set_visibility = ?,\n version = version + 1\n WHERE token = ?\n LIMIT 1\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 6
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "4ed42766cc0ca2234b7bc1837d645d05198d483564b39a2a8b8034df25e287a4"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nUPDATE user_bookmarks\nSET\ndeleted_at = CURRENT_TIMESTAMP,\nversion = version + 1\nWHERE\ntoken = ?\nAND user_token = ?\nLIMIT 1\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 2
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "576e5a72e385d44a1e53dc473dd0b5a04e33d7c6b9c38bef96f275b064a12386"
|
||||
}
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nUPDATE favorites\nSET\ndeleted_at = CURRENT_TIMESTAMP,\nversion = version + 1\nWHERE\ntoken = ?\nAND user_token = ?\nLIMIT 1\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 2
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "6a9fc0a3d983eb1d2bdf7d4c80904d73b9f4a649098fc0ba78cbc20cfde12437"
|
||||
}
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nINSERT INTO favorites\nSET\n token = ?,\n user_token = ?,\n entity_type = ?,\n entity_token = ?\n\nON DUPLICATE KEY UPDATE\n deleted_at = NULL,\n version = version + 1\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 4
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "72eaa9124662acf0ed354b868fcdfe33c94b61046c30940f55cdc73789f94041"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\n UPDATE model_weights\n SET\n title = COALESCE(?, title),\n description_markdown = COALESCE(?, description_markdown),\n maybe_thumbnail_token = COALESCE(?, maybe_thumbnail_token),\n description_rendered_html = COALESCE(?, description_rendered_html),\n creator_set_visibility = COALESCE(?, creator_set_visibility),\n version = version + 1\n WHERE token = ?\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 6
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "81df77a84fee48398e8a07e053b0393a0e341caf652c18c7160dd0a59247a19a"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nINSERT INTO media_files\nSET\n token = ?,\n\n origin_category = ?,\n origin_product_category = ?,\n\n media_type = ?,\n maybe_mime_type = ?,\n file_size_bytes = ?,\n checksum_sha2 = ?,\n\n maybe_origin_filename = ?,\n\n public_bucket_directory_hash = ?,\n maybe_public_bucket_prefix = ?,\n maybe_public_bucket_extension = ?,\n\n maybe_creator_user_token = ?,\n creator_ip_address = ?,\n\n creator_set_visibility = ?\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 14
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "8f8b81d54aeabb31a200de98ba3106ac6bea906979c89355f805abb9650a7588"
|
||||
}
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nSELECT\n f.token as `token: tokens::tokens::favorites::FavoriteToken`,\n f.entity_type as `entity_type: enums::by_table::favorites::favorite_entity_type::FavoriteEntityType`,\n f.entity_token,\n f.user_token as `user_token: tokens::tokens::users::UserToken`,\n u.username,\n u.display_name as user_display_name,\n u.email_gravatar_hash as user_gravatar_hash,\n f.created_at,\n f.updated_at,\n f.deleted_at,\n\n media_files.media_type as `maybe_media_file_type: enums::by_table::media_files::media_file_type::MediaFileType`,\n media_files.origin_product_category as `maybe_media_file_origin_category: enums::by_table::media_files::media_file_origin_category::MediaFileOriginCategory`,\n\n tts_models.title as maybe_descriptive_text_tts_model_title,\n tts_results.raw_inference_text as maybe_descriptive_text_tts_result_inference_text,\n users.display_name as maybe_descriptive_text_user_display_name,\n voice_conversion_models.title as maybe_descriptive_text_voice_conversion_model_title,\n zs_voices.title as maybe_descriptive_text_zs_voice_title\n\nFROM\n favorites AS f\nJOIN users AS u\n ON f.user_token = u.token\n\nLEFT OUTER JOIN media_files ON media_files.token = f.entity_token\nLEFT OUTER JOIN tts_models ON tts_models.token = f.entity_token\nLEFT OUTER JOIN tts_results ON tts_results.token = f.entity_token\nLEFT OUTER JOIN users ON users.token = f.entity_token\nLEFT OUTER JOIN voice_conversion_models ON voice_conversion_models.token = f.entity_token\nLEFT OUTER JOIN zs_voices ON zs_voices.token = f.entity_token\n\nWHERE\n u.username = ?\n AND f.entity_type = ?\n AND f.deleted_at IS NULL\nORDER BY f.id DESC\nLIMIT 50\n ",
|
||||
"query": "\nSELECT\n f.token as `token: tokens::tokens::user_bookmarks::UserBookmarkToken`,\n f.entity_type as `entity_type: enums::by_table::user_bookmarks::user_bookmark_entity_type::UserBookmarkEntityType`,\n f.entity_token,\n f.user_token as `user_token: tokens::tokens::users::UserToken`,\n u.username,\n u.display_name as user_display_name,\n u.email_gravatar_hash as user_gravatar_hash,\n f.created_at,\n f.updated_at,\n f.deleted_at,\n\n media_files.media_type as `maybe_media_file_type: enums::by_table::media_files::media_file_type::MediaFileType`,\n media_files.origin_product_category as `maybe_media_file_origin_category: enums::by_table::media_files::media_file_origin_category::MediaFileOriginCategory`,\n\n tts_models.title as maybe_descriptive_text_tts_model_title,\n tts_results.raw_inference_text as maybe_descriptive_text_tts_result_inference_text,\n users.display_name as maybe_descriptive_text_user_display_name,\n voice_conversion_models.title as maybe_descriptive_text_voice_conversion_model_title,\n zs_voices.title as maybe_descriptive_text_zs_voice_title\n\nFROM\n user_bookmarks AS f\nJOIN users AS u\n ON f.user_token = u.token\n\nLEFT OUTER JOIN media_files ON media_files.token = f.entity_token\nLEFT OUTER JOIN tts_models ON tts_models.token = f.entity_token\nLEFT OUTER JOIN tts_results ON tts_results.token = f.entity_token\nLEFT OUTER JOIN users ON users.token = f.entity_token\nLEFT OUTER JOIN voice_conversion_models ON voice_conversion_models.token = f.entity_token\nLEFT OUTER JOIN zs_voices ON zs_voices.token = f.entity_token\n\nWHERE\n u.username = ?\n AND f.entity_type = ?\n AND f.deleted_at IS NULL\nORDER BY f.id DESC\nLIMIT 50\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "token: tokens::tokens::favorites::FavoriteToken",
|
||||
"name": "token: tokens::tokens::user_bookmarks::UserBookmarkToken",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
|
||||
@@ -15,7 +15,7 @@
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "entity_type: enums::by_table::favorites::favorite_entity_type::FavoriteEntityType",
|
||||
"name": "entity_type: enums::by_table::user_bookmarks::user_bookmark_entity_type::UserBookmarkEntityType",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
|
||||
@@ -197,5 +197,5 @@
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "4214d8e86b81eb0138a34702ce12960ee007ca602a7bd64b68924515f8fbb038"
|
||||
"hash": "d9c00b3c78ed6ec31b281c7ea5fb1efd0cfa6b20899151f9e7f1a122c1f7a70e"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nINSERT INTO user_bookmarks\nSET\n token = ?,\n user_token = ?,\n entity_type = ?,\n entity_token = ?\n\nON DUPLICATE KEY UPDATE\n deleted_at = NULL,\n version = version + 1\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 4
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "e8f3bb68896d316498b52fdaaf4c352624b79bd4e097f57db5ad59f53fd66995"
|
||||
}
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"db_name": "MySQL",
|
||||
"query": "\nSELECT\n f.token as `token: tokens::tokens::favorites::FavoriteToken`,\n f.entity_type as `entity_type: enums::by_table::favorites::favorite_entity_type::FavoriteEntityType`,\n f.entity_token,\n f.user_token as `user_token: tokens::tokens::users::UserToken`,\n u.username,\n u.display_name as user_display_name,\n u.email_gravatar_hash as user_gravatar_hash,\n f.created_at,\n f.updated_at,\n f.deleted_at,\n\n media_files.media_type as `maybe_media_file_type: enums::by_table::media_files::media_file_type::MediaFileType`,\n media_files.origin_product_category as `maybe_media_file_origin_category: enums::by_table::media_files::media_file_origin_category::MediaFileOriginCategory`,\n\n tts_models.title as maybe_descriptive_text_tts_model_title,\n tts_results.raw_inference_text as maybe_descriptive_text_tts_result_inference_text,\n users.display_name as maybe_descriptive_text_user_display_name,\n voice_conversion_models.title as maybe_descriptive_text_voice_conversion_model_title,\n zs_voices.title as maybe_descriptive_text_zs_voice_title\n\nFROM\n favorites AS f\nJOIN users AS u\n ON f.user_token = u.token\n\nLEFT OUTER JOIN media_files ON media_files.token = f.entity_token\nLEFT OUTER JOIN tts_models ON tts_models.token = f.entity_token\nLEFT OUTER JOIN tts_results ON tts_results.token = f.entity_token\nLEFT OUTER JOIN users ON users.token = f.entity_token\nLEFT OUTER JOIN voice_conversion_models ON voice_conversion_models.token = f.entity_token\nLEFT OUTER JOIN zs_voices ON zs_voices.token = f.entity_token\n\nWHERE\n u.username = ?\n AND f.deleted_at IS NULL\nORDER BY f.id DESC\nLIMIT 50\n ",
|
||||
"query": "\nSELECT\n f.token as `token: tokens::tokens::user_bookmarks::UserBookmarkToken`,\n f.entity_type as `entity_type: enums::by_table::user_bookmarks::user_bookmark_entity_type::UserBookmarkEntityType`,\n f.entity_token,\n f.user_token as `user_token: tokens::tokens::users::UserToken`,\n u.username,\n u.display_name as user_display_name,\n u.email_gravatar_hash as user_gravatar_hash,\n f.created_at,\n f.updated_at,\n f.deleted_at,\n\n media_files.media_type as `maybe_media_file_type: enums::by_table::media_files::media_file_type::MediaFileType`,\n media_files.origin_product_category as `maybe_media_file_origin_category: enums::by_table::media_files::media_file_origin_category::MediaFileOriginCategory`,\n\n tts_models.title as maybe_descriptive_text_tts_model_title,\n tts_results.raw_inference_text as maybe_descriptive_text_tts_result_inference_text,\n users.display_name as maybe_descriptive_text_user_display_name,\n voice_conversion_models.title as maybe_descriptive_text_voice_conversion_model_title,\n zs_voices.title as maybe_descriptive_text_zs_voice_title\n\nFROM\n user_bookmarks AS f\nJOIN users AS u\n ON f.user_token = u.token\n\nLEFT OUTER JOIN media_files ON media_files.token = f.entity_token\nLEFT OUTER JOIN tts_models ON tts_models.token = f.entity_token\nLEFT OUTER JOIN tts_results ON tts_results.token = f.entity_token\nLEFT OUTER JOIN users ON users.token = f.entity_token\nLEFT OUTER JOIN voice_conversion_models ON voice_conversion_models.token = f.entity_token\nLEFT OUTER JOIN zs_voices ON zs_voices.token = f.entity_token\n\nWHERE\n u.username = ?\n AND f.deleted_at IS NULL\nORDER BY f.id DESC\nLIMIT 50\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "token: tokens::tokens::favorites::FavoriteToken",
|
||||
"name": "token: tokens::tokens::user_bookmarks::UserBookmarkToken",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
|
||||
@@ -15,7 +15,7 @@
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "entity_type: enums::by_table::favorites::favorite_entity_type::FavoriteEntityType",
|
||||
"name": "entity_type: enums::by_table::user_bookmarks::user_bookmark_entity_type::UserBookmarkEntityType",
|
||||
"type_info": {
|
||||
"type": "VarString",
|
||||
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
|
||||
@@ -197,5 +197,5 @@
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "c33f8df5a9ed1991366d6078460d9e936a5470d1794ea319d6cf19b0f5338fd4"
|
||||
"hash": "eea9531d5261833b93baadee8b99449362c074fc2397e23ecd175b6a0425b16b"
|
||||
}
|
||||
Generated
+259
-453
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -87,7 +87,8 @@ members = [
|
||||
|
||||
# Vendored code
|
||||
"crates/vendor/limitation",
|
||||
"crates/vendor/newrelic-telemetry-sdk-rust",
|
||||
# NB(bt,2023-12-12): Newrelic keeps breaking with upgrades. Kill for now.
|
||||
#"crates/vendor/newrelic-telemetry-sdk-rust",
|
||||
|
||||
# cargo-hakari workspace hack (compilation speedup hack)
|
||||
"crates/my-workspace-hack",
|
||||
|
||||
@@ -344,6 +344,36 @@ where token IN (
|
||||
'vcm_zmxv2k1q9jd8'
|
||||
);
|
||||
|
||||
update voice_conversion_models
|
||||
set
|
||||
mod_deleted_at = NOW(),
|
||||
maybe_mod_comments = 'takedown request'
|
||||
where token IN (
|
||||
'vcm_3mzcjkf78x7m',
|
||||
'vcm_7k2t1wnyqxsc',
|
||||
'vcm_w2edpe6q2nya',
|
||||
'vcm_vz9cg294xa29',
|
||||
'vcm_0z1ys58589k7',
|
||||
'vcm_4x8a30h1r26z',
|
||||
'vcm_0vf9prxsww60',
|
||||
'vcm_yxbadkvqhg16',
|
||||
'vcm_p0ezrc6wvzak',
|
||||
'vcm_6r5pbtexyvtp',
|
||||
'vcm_pb0ewrf7ych5',
|
||||
'vcm_7frb2xk0cxk3',
|
||||
'vcm_x129c9s2af06',
|
||||
'vcm_e0snndfd59b6',
|
||||
'vcm_nb8zb0djqwqw',
|
||||
'vcm_2erz5hbh8tpf',
|
||||
'vcm_e9wn2ccqe3bk',
|
||||
'vcm_f8jbxdbjgcjb',
|
||||
'vcm_x02h7z3jqxb0',
|
||||
'vcm_xy97xcgnk9y6',
|
||||
'vcm_a47wtfbsjrfc',
|
||||
'vcm_kygenhbg5mgj',
|
||||
'vcm_s8gndv19yt7p'
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
-- noinspection SqlDialectInspectionForFile
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
DROP TABLE user_bookmarks;
|
||||
@@ -0,0 +1,46 @@
|
||||
-- noinspection SqlDialectInspectionForFile
|
||||
-- noinspection SqlNoDataSourceInspectionForFile
|
||||
-- noinspection SqlResolveForFile
|
||||
|
||||
-- Favorites that can be attached to just about anything.
|
||||
-- This is a polymorphic table and can apply to a wide variety of entities.
|
||||
CREATE TABLE user_bookmarks
|
||||
(
|
||||
-- Not used for anything except replication.
|
||||
id BIGINT(20) NOT NULL AUTO_INCREMENT,
|
||||
|
||||
-- Effective "primary key" (PUBLIC)
|
||||
token VARCHAR(32) NOT NULL,
|
||||
|
||||
-- User making the favorite
|
||||
user_token VARCHAR(32) NOT NULL,
|
||||
|
||||
-- The type of entity the favorite applies to
|
||||
entity_type VARCHAR(32) NOT NULL,
|
||||
|
||||
-- The token of the entity the favorite applies to
|
||||
entity_token VARCHAR(32) NOT NULL,
|
||||
|
||||
-- ========== VECTOR CLOCK ==========
|
||||
|
||||
-- Incremented with every update.
|
||||
version INT NOT NULL DEFAULT 0,
|
||||
|
||||
-- ========== TIMESTAMPS ==========
|
||||
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
deleted_at TIMESTAMP NULL,
|
||||
|
||||
-- INDICES --
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY (token),
|
||||
KEY index_entity_type_entity_token (entity_type, entity_token),
|
||||
KEY index_user_token_entity_token (user_token, entity_type),
|
||||
KEY index_user_token (user_token),
|
||||
KEY index_created_at (created_at),
|
||||
KEY index_user_deleted_at (deleted_at)
|
||||
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_bin;
|
||||
@@ -17,6 +17,8 @@ path = "src/lib.rs"
|
||||
# Internal
|
||||
crockford = { path = "../../lib/crockford" }
|
||||
errors = { path = "../../lib/errors" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
pub mod private_path;
|
||||
pub mod private_path;
|
||||
pub mod zs_voices;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
use crockford::crockford_entropy_lower;
|
||||
use crate::private::private_path::PrivatePath;
|
||||
|
||||
use crate::private::private_path::PrivatePath;
|
||||
use crate::util::hashed_directory_path_long_string::hashed_directory_path_long_string;
|
||||
|
||||
// TODO: Generate these from a macro.
|
||||
@@ -79,7 +79,7 @@ impl ZeroShotVoiceEmbeddingBucketDirectory {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::public::zs_voices::directory::{ModelCategory, ModelType, ZeroShotVoiceEmbeddingBucketDirectory};
|
||||
use crate::private::zs_voices::bucket_directory::{ModelCategory, ModelType, ZeroShotVoiceEmbeddingBucketDirectory};
|
||||
|
||||
#[test]
|
||||
pub fn generate_new_entropy() {
|
||||
+6
-9
@@ -3,11 +3,10 @@ use std::path::PathBuf;
|
||||
use crockford::crockford_entropy_lower;
|
||||
|
||||
use crate::private::private_path::PrivatePath;
|
||||
use crate::public::zs_voices::directory::{ModelCategory, ModelType, ZeroShotVoiceEmbeddingBucketDirectory};
|
||||
use crate::private::zs_voices::bucket_directory::{ModelCategory, ModelType, ZeroShotVoiceEmbeddingBucketDirectory};
|
||||
|
||||
// TODO: Generate these from a macro.
|
||||
|
||||
|
||||
/// The original user upload file.
|
||||
/// It may have derivative files (down samples, crops, etc.) that live alongside it.
|
||||
#[derive(Clone)]
|
||||
@@ -74,11 +73,9 @@ impl ZeroShotVoiceEmbeddingBucketPath {
|
||||
mod tests {
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::public::media_files::original_file::MediaFileBucketPath;
|
||||
|
||||
mod with_prefix_and_extension {
|
||||
use crate::public::zs_voices::directory::ModelCategory;
|
||||
use crate::public::zs_voices::file::{ModelType, ZeroShotVoiceEmbeddingBucketPath};
|
||||
use crate::private::zs_voices::bucket_directory::ModelCategory;
|
||||
use crate::private::zs_voices::bucket_file_path::{ModelType, ZeroShotVoiceEmbeddingBucketPath};
|
||||
|
||||
#[test]
|
||||
pub fn generate_new_entropy() {
|
||||
@@ -97,8 +94,8 @@ mod tests {
|
||||
}
|
||||
|
||||
mod without_prefix_and_extension {
|
||||
use crate::public::zs_voices::directory::ModelCategory;
|
||||
use crate::public::zs_voices::file::{ModelType, ZeroShotVoiceEmbeddingBucketPath};
|
||||
use crate::private::zs_voices::bucket_directory::ModelCategory;
|
||||
use crate::private::zs_voices::bucket_file_path::{ModelType, ZeroShotVoiceEmbeddingBucketPath};
|
||||
|
||||
use super::*;
|
||||
|
||||
@@ -135,7 +132,7 @@ mod tests {
|
||||
#[test]
|
||||
pub fn get_object_hash() {
|
||||
let hash = "abcdefghijk";
|
||||
let file = MediaFileBucketPath::from_object_hash(hash, None, None);
|
||||
let file = ZeroShotVoiceEmbeddingBucketPath::from_object_hash(hash, ModelCategory::Tts, ModelType::VallEx, 1);
|
||||
assert_eq!(file.get_object_hash(), hash);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
pub mod bucket_directory;
|
||||
pub mod bucket_file_path;
|
||||
+1
-2
@@ -4,7 +4,6 @@ use crate::public::public_path::PublicPath;
|
||||
use crate::util::hashed_directory_path_long_string::hashed_directory_path_long_string;
|
||||
|
||||
// TODO: Generate these from a macro.
|
||||
|
||||
// TODO: Use a central path registry for quick reference
|
||||
const MEDIA_FILE_DIRECTORY: &str = "/media";
|
||||
|
||||
@@ -47,7 +46,7 @@ impl MediaFileBucketDirectory {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::public::media_files::directory::MediaFileBucketDirectory;
|
||||
use crate::public::media_files::bucket_directory::MediaFileBucketDirectory;
|
||||
|
||||
#[test]
|
||||
pub fn generate_new_entropy() {
|
||||
+2
-2
@@ -2,7 +2,7 @@ use std::path::PathBuf;
|
||||
|
||||
use crockford::crockford_entropy_lower;
|
||||
|
||||
use crate::public::media_files::directory::MediaFileBucketDirectory;
|
||||
use crate::public::media_files::bucket_directory::MediaFileBucketDirectory;
|
||||
use crate::public::public_path::PublicPath;
|
||||
|
||||
const ORIGINAL_FILE_BASENAME : &str = "file.bin";
|
||||
@@ -79,7 +79,7 @@ impl MediaFileBucketPath {
|
||||
mod tests {
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::public::media_files::original_file::MediaFileBucketPath;
|
||||
use crate::public::media_files::bucket_file_path::MediaFileBucketPath;
|
||||
|
||||
mod with_prefix_and_extension {
|
||||
use super::*;
|
||||
@@ -1,2 +1,2 @@
|
||||
pub mod directory;
|
||||
pub mod original_file;
|
||||
pub mod bucket_directory;
|
||||
pub mod bucket_file_path;
|
||||
+1
-1
@@ -47,7 +47,7 @@ impl MediaUploadDirectory {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::public::media_uploads::directory::MediaUploadDirectory;
|
||||
use crate::public::media_uploads::bucket_directory::MediaUploadDirectory;
|
||||
|
||||
#[test]
|
||||
pub fn generate_new_entropy() {
|
||||
+2
-2
@@ -2,7 +2,7 @@ use std::path::PathBuf;
|
||||
|
||||
use crockford::crockford_entropy_lower;
|
||||
|
||||
use crate::public::media_uploads::directory::MediaUploadDirectory;
|
||||
use crate::public::media_uploads::bucket_directory::MediaUploadDirectory;
|
||||
use crate::public::public_path::PublicPath;
|
||||
|
||||
const ORIGINAL_FILE_BASENAME : &str = "original_upload.bin";
|
||||
@@ -61,7 +61,7 @@ impl MediaUploadOriginalFilePath {
|
||||
mod tests {
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::public::media_uploads::original_file::MediaUploadOriginalFilePath;
|
||||
use crate::public::media_uploads::bucket_file_path::MediaUploadOriginalFilePath;
|
||||
|
||||
#[test]
|
||||
pub fn generate_new_entropy() {
|
||||
@@ -1,2 +1,2 @@
|
||||
pub mod directory;
|
||||
pub mod original_file;
|
||||
pub mod bucket_directory;
|
||||
pub mod bucket_file_path;
|
||||
@@ -2,5 +2,4 @@ pub mod media_files;
|
||||
pub mod media_uploads;
|
||||
pub mod public_path;
|
||||
pub mod voice_conversion_results;
|
||||
pub mod zs_voices;
|
||||
pub mod weight_uploads;
|
||||
+1
-1
@@ -40,7 +40,7 @@ impl VoiceConversionResultDirectory {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::public::voice_conversion_results::directory::VoiceConversionResultDirectory;
|
||||
use crate::public::voice_conversion_results::bucket_directory::VoiceConversionResultDirectory;
|
||||
|
||||
#[test]
|
||||
pub fn get_directory_path_str() {
|
||||
+2
-2
@@ -3,7 +3,7 @@ use std::path::PathBuf;
|
||||
use crockford::crockford_entropy_lower;
|
||||
|
||||
use crate::public::public_path::PublicPath;
|
||||
use crate::public::voice_conversion_results::directory::VoiceConversionResultDirectory;
|
||||
use crate::public::voice_conversion_results::bucket_directory::VoiceConversionResultDirectory;
|
||||
|
||||
const ORIGINAL_FILE_PREFIX : &str = "fakeyou_";
|
||||
const ORIGINAL_FILE_SUFFIX : &str = ".wav";
|
||||
@@ -65,7 +65,7 @@ impl VoiceConversionResultOriginalFilePath {
|
||||
mod tests {
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::public::voice_conversion_results::original_file::VoiceConversionResultOriginalFilePath;
|
||||
use crate::public::voice_conversion_results::bucket_file_path::VoiceConversionResultOriginalFilePath;
|
||||
|
||||
#[test]
|
||||
pub fn generate_new_entropy() {
|
||||
@@ -1,2 +1,2 @@
|
||||
pub mod directory;
|
||||
pub mod original_file;
|
||||
pub mod bucket_directory;
|
||||
pub mod bucket_file_path;
|
||||
+1
-1
@@ -48,7 +48,7 @@ impl WeightUploadDirectory {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::public::weight_uploads::directory::WeightUploadDirectory;
|
||||
use crate::public::weight_uploads::bucket_directory::WeightUploadDirectory;
|
||||
|
||||
#[test]
|
||||
pub fn generate_new_entropy() {
|
||||
+3
-2
@@ -2,8 +2,8 @@ use std::path::PathBuf;
|
||||
|
||||
use crockford::crockford_entropy_lower;
|
||||
|
||||
use crate::public::weight_uploads::directory::WeightUploadDirectory;
|
||||
use crate::public::public_path::PublicPath;
|
||||
use crate::public::weight_uploads::bucket_directory::WeightUploadDirectory;
|
||||
|
||||
const ORIGINAL_FILE_BASENAME : &str = "original_upload.bin";
|
||||
|
||||
@@ -56,7 +56,8 @@ impl WeightUploadOriginalFilePath {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::path::PathBuf;
|
||||
use crate::public::weight_uploads::original_file::WeightUploadOriginalFilePath;
|
||||
|
||||
use crate::public::weight_uploads::bucket_file_path::WeightUploadOriginalFilePath;
|
||||
|
||||
#[test]
|
||||
pub fn generate_new_entropy() {
|
||||
@@ -1,2 +1,2 @@
|
||||
pub mod directory;
|
||||
pub mod original_file;
|
||||
pub mod bucket_directory;
|
||||
pub mod bucket_file_path;
|
||||
@@ -1,2 +0,0 @@
|
||||
pub mod directory;
|
||||
pub mod file;
|
||||
@@ -13,6 +13,11 @@ name = "enums"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
# Internal
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# Serialization
|
||||
serde = "1.0.125"
|
||||
serde_derive = "1.0.125"
|
||||
@@ -21,7 +26,6 @@ sqlx = { version = "0.7.2", features = [ "mysql", "sqlite", "runtime-tokio-nativ
|
||||
sqlx-core = { version = "0.7.2" }
|
||||
sqlx-mysql= { version = "0.7.2" }
|
||||
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
utoipa = { version = "4", features = ["chrono","actix_extras"] }
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
#[cfg(test)]
|
||||
use strum::EnumCount;
|
||||
#[cfg(test)]
|
||||
use strum::EnumIter;
|
||||
|
||||
/// Used in the `favorites` table in a `VARCHAR(32)` field named `entity_type`.
|
||||
#[cfg_attr(test, derive(EnumIter, EnumCount))]
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Hash, Deserialize, Serialize)]
|
||||
pub enum FavoriteEntityType {
|
||||
/// User
|
||||
#[serde(rename = "user")]
|
||||
User,
|
||||
|
||||
/// TTS model (architecture does not matter)
|
||||
#[serde(rename = "tts_model")]
|
||||
TtsModel,
|
||||
|
||||
/// TTS result (architecture does not matter)
|
||||
#[serde(rename = "tts_result")]
|
||||
TtsResult,
|
||||
|
||||
/// W2L template
|
||||
#[serde(rename = "w2l_template")]
|
||||
W2lTemplate,
|
||||
|
||||
/// W2L result
|
||||
#[serde(rename = "w2l_result")]
|
||||
W2lResult,
|
||||
|
||||
/// MediaFile
|
||||
#[serde(rename = "media_file")]
|
||||
MediaFile,
|
||||
|
||||
/// VoiceConversionModel
|
||||
#[serde(rename = "voice_conversion_model")]
|
||||
VoiceConversionModel,
|
||||
|
||||
/// ZsVoice
|
||||
#[serde(rename = "zs_voice")]
|
||||
ZsVoice,
|
||||
}
|
||||
|
||||
// TODO(bt, 2023-01-17): This desperately needs MySQL integration tests!
|
||||
impl_enum_display_and_debug_using_to_str!(FavoriteEntityType);
|
||||
impl_mysql_enum_coders!(FavoriteEntityType);
|
||||
|
||||
/// NB: Legacy API for older code.
|
||||
impl FavoriteEntityType {
|
||||
pub fn to_str(&self) -> &'static str {
|
||||
match self {
|
||||
Self::User => "user",
|
||||
Self::TtsModel => "tts_model",
|
||||
Self::TtsResult => "tts_result",
|
||||
Self::W2lTemplate => "w2l_template",
|
||||
Self::W2lResult => "w2l_result",
|
||||
Self::MediaFile => "media_file",
|
||||
Self::VoiceConversionModel => "voice_conversion_model",
|
||||
Self::ZsVoice => "zs_voice",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_str(value: &str) -> Result<Self, String> {
|
||||
match value {
|
||||
"user" => Ok(Self::User),
|
||||
"tts_model" => Ok(Self::TtsModel),
|
||||
"tts_result" => Ok(Self::TtsResult),
|
||||
"w2l_template" => Ok(Self::W2lTemplate),
|
||||
"w2l_result" => Ok(Self::W2lResult),
|
||||
"media_file" => Ok(Self::MediaFile),
|
||||
"voice_conversion_model" => Ok(Self::VoiceConversionModel),
|
||||
"zs_voice" => Ok(Self::ZsVoice),
|
||||
_ => Err(format!("invalid value: {:?}", value)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::by_table::favorites::favorite_entity_type::FavoriteEntityType;
|
||||
use crate::test_helpers::assert_serialization;
|
||||
|
||||
mod serde {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_serialization() {
|
||||
assert_serialization(FavoriteEntityType::User, "user");
|
||||
assert_serialization(FavoriteEntityType::TtsModel, "tts_model");
|
||||
assert_serialization(FavoriteEntityType::TtsResult, "tts_result");
|
||||
assert_serialization(FavoriteEntityType::W2lTemplate, "w2l_template");
|
||||
assert_serialization(FavoriteEntityType::W2lResult, "w2l_result");
|
||||
assert_serialization(FavoriteEntityType::MediaFile, "media_file");
|
||||
assert_serialization(FavoriteEntityType::VoiceConversionModel, "voice_conversion_model");
|
||||
assert_serialization(FavoriteEntityType::ZsVoice, "zs_voice");
|
||||
}
|
||||
}
|
||||
|
||||
mod impl_methods {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_to_str() {
|
||||
assert_eq!(FavoriteEntityType::User.to_str(), "user");
|
||||
assert_eq!(FavoriteEntityType::TtsModel.to_str(), "tts_model");
|
||||
assert_eq!(FavoriteEntityType::TtsResult.to_str(), "tts_result");
|
||||
assert_eq!(FavoriteEntityType::W2lTemplate.to_str(), "w2l_template");
|
||||
assert_eq!(FavoriteEntityType::W2lResult.to_str(), "w2l_result");
|
||||
assert_eq!(FavoriteEntityType::MediaFile.to_str(), "media_file");
|
||||
assert_eq!(FavoriteEntityType::VoiceConversionModel.to_str(), "voice_conversion_model");
|
||||
assert_eq!(FavoriteEntityType::ZsVoice.to_str(), "zs_voice");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_from_str() {
|
||||
assert_eq!(FavoriteEntityType::from_str("user").unwrap(), FavoriteEntityType::User);
|
||||
assert_eq!(FavoriteEntityType::from_str("tts_model").unwrap(), FavoriteEntityType::TtsModel);
|
||||
assert_eq!(FavoriteEntityType::from_str("tts_result").unwrap(), FavoriteEntityType::TtsResult);
|
||||
assert_eq!(FavoriteEntityType::from_str("w2l_template").unwrap(), FavoriteEntityType::W2lTemplate);
|
||||
assert_eq!(FavoriteEntityType::from_str("w2l_result").unwrap(), FavoriteEntityType::W2lResult);
|
||||
assert_eq!(FavoriteEntityType::from_str("media_file").unwrap(), FavoriteEntityType::MediaFile);
|
||||
assert_eq!(FavoriteEntityType::from_str("voice_conversion_model").unwrap(), FavoriteEntityType::VoiceConversionModel);
|
||||
assert_eq!(FavoriteEntityType::from_str("zs_voice").unwrap(), FavoriteEntityType::ZsVoice);
|
||||
assert!(FavoriteEntityType::from_str("foo").is_err());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
pub mod favorite_entity_type;
|
||||
@@ -25,6 +25,9 @@ pub enum InferenceCategory {
|
||||
|
||||
#[serde(rename = "voice_conversion")]
|
||||
VoiceConversion,
|
||||
|
||||
#[serde(rename = "video_filter")]
|
||||
VideoFilter,
|
||||
}
|
||||
|
||||
// TODO(bt, 2022-12-21): This desperately needs MySQL integration tests!
|
||||
@@ -38,6 +41,7 @@ impl InferenceCategory {
|
||||
Self::LipsyncAnimation => "lipsync_animation",
|
||||
Self::TextToSpeech => "text_to_speech",
|
||||
Self::VoiceConversion => "voice_conversion",
|
||||
Self::VideoFilter => "video_filter",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +50,7 @@ impl InferenceCategory {
|
||||
"lipsync_animation" => Ok(Self::LipsyncAnimation),
|
||||
"text_to_speech" => Ok(Self::TextToSpeech),
|
||||
"voice_conversion" => Ok(Self::VoiceConversion),
|
||||
"video_filter" => Ok(Self::VideoFilter),
|
||||
_ => Err(format!("invalid value: {:?}", value)),
|
||||
}
|
||||
}
|
||||
@@ -57,6 +62,7 @@ impl InferenceCategory {
|
||||
Self::LipsyncAnimation,
|
||||
Self::TextToSpeech,
|
||||
Self::VoiceConversion,
|
||||
Self::VideoFilter,
|
||||
])
|
||||
}
|
||||
}
|
||||
@@ -71,6 +77,7 @@ mod tests {
|
||||
assert_serialization(InferenceCategory::LipsyncAnimation, "lipsync_animation");
|
||||
assert_serialization(InferenceCategory::TextToSpeech, "text_to_speech");
|
||||
assert_serialization(InferenceCategory::VoiceConversion, "voice_conversion");
|
||||
assert_serialization(InferenceCategory::VideoFilter, "video_filter");
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -78,6 +85,7 @@ mod tests {
|
||||
assert_eq!(InferenceCategory::LipsyncAnimation.to_str(), "lipsync_animation");
|
||||
assert_eq!(InferenceCategory::TextToSpeech.to_str(), "text_to_speech");
|
||||
assert_eq!(InferenceCategory::VoiceConversion.to_str(), "voice_conversion");
|
||||
assert_eq!(InferenceCategory::VideoFilter.to_str(), "video_filter");
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -85,16 +93,18 @@ mod tests {
|
||||
assert_eq!(InferenceCategory::from_str("lipsync_animation").unwrap(), InferenceCategory::LipsyncAnimation);
|
||||
assert_eq!(InferenceCategory::from_str("text_to_speech").unwrap(), InferenceCategory::TextToSpeech);
|
||||
assert_eq!(InferenceCategory::from_str("voice_conversion").unwrap(), InferenceCategory::VoiceConversion);
|
||||
assert_eq!(InferenceCategory::from_str("video_filter").unwrap(), InferenceCategory::VideoFilter);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn all_variants() {
|
||||
// Static check
|
||||
let mut variants = InferenceCategory::all_variants();
|
||||
assert_eq!(variants.len(), 3);
|
||||
assert_eq!(variants.len(), 4);
|
||||
assert_eq!(variants.pop_first(), Some(InferenceCategory::LipsyncAnimation));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceCategory::TextToSpeech));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceCategory::VoiceConversion));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceCategory::VideoFilter));
|
||||
assert_eq!(variants.pop_first(), None);
|
||||
|
||||
// Generated check
|
||||
|
||||
@@ -31,6 +31,8 @@ pub enum InferenceModelType {
|
||||
Vits,
|
||||
#[serde(rename = "vall_e_x")]
|
||||
VallEX,
|
||||
#[serde(rename = "rerender_a_video")]
|
||||
RerenderAVideo,
|
||||
}
|
||||
|
||||
// TODO(bt, 2022-12-21): This desperately needs MySQL integration tests!
|
||||
@@ -46,7 +48,8 @@ impl InferenceModelType {
|
||||
Self::SoVitsSvc => "so_vits_svc",
|
||||
Self::Tacotron2 => "tacotron2",
|
||||
Self::Vits => "vits",
|
||||
Self::VallEX => "vall_e_x"
|
||||
Self::VallEX => "vall_e_x",
|
||||
Self::RerenderAVideo => "rerender_a_video",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +61,7 @@ impl InferenceModelType {
|
||||
"tacotron2" => Ok(Self::Tacotron2),
|
||||
"vits" => Ok(Self::Vits),
|
||||
"vall_e_x" => Ok(Self::VallEX),
|
||||
"rerender_a_video" => Ok(Self::RerenderAVideo),
|
||||
_ => Err(format!("invalid value: {:?}", value)),
|
||||
}
|
||||
}
|
||||
@@ -71,7 +75,8 @@ impl InferenceModelType {
|
||||
InferenceModelType::SoVitsSvc,
|
||||
InferenceModelType::Tacotron2,
|
||||
InferenceModelType::Vits,
|
||||
InferenceModelType::VallEX
|
||||
InferenceModelType::VallEX,
|
||||
InferenceModelType::RerenderAVideo
|
||||
])
|
||||
}
|
||||
}
|
||||
@@ -89,6 +94,7 @@ mod tests {
|
||||
assert_serialization(InferenceModelType::Tacotron2, "tacotron2");
|
||||
assert_serialization(InferenceModelType::Vits, "vits");
|
||||
assert_serialization(InferenceModelType::VallEX, "vall_e_x");
|
||||
assert_serialization(InferenceModelType::RerenderAVideo, "rerender_a_video");
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -99,6 +105,7 @@ mod tests {
|
||||
assert_eq!(InferenceModelType::Tacotron2.to_str(), "tacotron2");
|
||||
assert_eq!(InferenceModelType::Vits.to_str(), "vits");
|
||||
assert_eq!(InferenceModelType::VallEX.to_str(), "vall_e_x");
|
||||
assert_eq!(InferenceModelType::RerenderAVideo.to_str(), "rerender_a_video");
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -109,19 +116,21 @@ mod tests {
|
||||
assert_eq!(InferenceModelType::from_str("tacotron2").unwrap(), InferenceModelType::Tacotron2);
|
||||
assert_eq!(InferenceModelType::from_str("vits").unwrap(), InferenceModelType::Vits);
|
||||
assert_eq!(InferenceModelType::from_str("vall_e_x").unwrap(), InferenceModelType::VallEX);
|
||||
assert_eq!(InferenceModelType::from_str("rerender_a_video").unwrap(), InferenceModelType::RerenderAVideo);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn all_variants() {
|
||||
// Static check
|
||||
let mut variants = InferenceModelType::all_variants();
|
||||
assert_eq!(variants.len(), 6);
|
||||
assert_eq!(variants.len(), 7);
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::RvcV2));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::SadTalker));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::SoVitsSvc));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::Tacotron2));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::Vits));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::VallEX));
|
||||
assert_eq!(variants.pop_first(), Some(InferenceModelType::RerenderAVideo));
|
||||
assert_eq!(variants.pop_first(), None);
|
||||
|
||||
// Generated check
|
||||
|
||||
@@ -21,6 +21,10 @@ pub enum IdCategory {
|
||||
#[serde(rename = "lipsync_animation")]
|
||||
LipsyncAnimationResult,
|
||||
|
||||
// Results from video filters
|
||||
#[serde(rename = "video_filter")]
|
||||
VideoFilterResult,
|
||||
|
||||
/// Results from tacotron2
|
||||
/// Applies for RVC and SVC
|
||||
#[serde(rename = "tts_result")]
|
||||
@@ -62,6 +66,7 @@ impl IdCategory {
|
||||
Self::ZeroShotVoiceDataset => "zs_dataset",
|
||||
Self::ZeroShotVoiceEmbedding => "zs_voice",
|
||||
Self::ZeroShotTtsResult => "zs_tts_result",
|
||||
Self::VideoFilterResult => "video_filter",
|
||||
Self::ModelWeights => "model_weights",
|
||||
}
|
||||
}
|
||||
@@ -75,6 +80,7 @@ impl IdCategory {
|
||||
"zs_dataset" => Ok(Self::ZeroShotVoiceDataset),
|
||||
"zs_voice" => Ok(Self::ZeroShotVoiceEmbedding),
|
||||
"zs_tts_result" => Ok(Self::ZeroShotTtsResult),
|
||||
"video_filter" => Ok(Self::VideoFilterResult),
|
||||
"model_weights" => Ok(Self::ModelWeights),
|
||||
_ => Err(format!("invalid value: {:?}", value)),
|
||||
}
|
||||
@@ -86,6 +92,7 @@ impl IdCategory {
|
||||
BTreeSet::from([
|
||||
Self::MediaFile,
|
||||
Self::LipsyncAnimationResult,
|
||||
Self::VideoFilterResult,
|
||||
Self::TtsResult,
|
||||
Self::VoiceConversionResult,
|
||||
Self::ZeroShotTtsResult,
|
||||
@@ -108,6 +115,7 @@ mod tests {
|
||||
fn test_serialization() {
|
||||
assert_serialization(IdCategory::MediaFile, "media_file");
|
||||
assert_serialization(IdCategory::LipsyncAnimationResult, "lipsync_animation");
|
||||
assert_serialization(IdCategory::VideoFilterResult, "video_filter");
|
||||
assert_serialization(IdCategory::TtsResult, "tts_result");
|
||||
assert_serialization(IdCategory::VoiceConversionResult, "voice_conversion");
|
||||
assert_serialization(IdCategory::ZeroShotVoiceDataset, "zs_dataset");
|
||||
@@ -120,6 +128,7 @@ mod tests {
|
||||
fn to_str() {
|
||||
assert_eq!(IdCategory::MediaFile.to_str(), "media_file");
|
||||
assert_eq!(IdCategory::LipsyncAnimationResult.to_str(), "lipsync_animation");
|
||||
assert_eq!(IdCategory::VideoFilterResult.to_str(), "video_filter");
|
||||
assert_eq!(IdCategory::TtsResult.to_str(), "tts_result");
|
||||
assert_eq!(IdCategory::VoiceConversionResult.to_str(), "voice_conversion");
|
||||
assert_eq!(IdCategory::ZeroShotVoiceDataset.to_str(), "zs_dataset");
|
||||
@@ -132,6 +141,7 @@ mod tests {
|
||||
fn from_str() {
|
||||
assert_eq!(IdCategory::from_str("media_file").unwrap(), IdCategory::MediaFile);
|
||||
assert_eq!(IdCategory::from_str("lipsync_animation").unwrap(), IdCategory::LipsyncAnimationResult);
|
||||
assert_eq!(IdCategory::from_str("video_filter").unwrap(), IdCategory::VideoFilterResult);
|
||||
assert_eq!(IdCategory::from_str("tts_result").unwrap(), IdCategory::TtsResult);
|
||||
assert_eq!(IdCategory::from_str("voice_conversion").unwrap(), IdCategory::VoiceConversionResult);
|
||||
assert_eq!(IdCategory::from_str("zs_dataset").unwrap(), IdCategory::ZeroShotVoiceDataset);
|
||||
@@ -144,9 +154,10 @@ mod tests {
|
||||
fn all_variants() {
|
||||
// Static check
|
||||
let mut variants = IdCategory::all_variants();
|
||||
assert_eq!(variants.len(), 8);
|
||||
assert_eq!(variants.len(), 9);
|
||||
assert_eq!(variants.pop_first(), Some(IdCategory::MediaFile));
|
||||
assert_eq!(variants.pop_first(), Some(IdCategory::LipsyncAnimationResult));
|
||||
assert_eq!(variants.pop_first(), Some(IdCategory::VideoFilterResult));
|
||||
assert_eq!(variants.pop_first(), Some(IdCategory::TtsResult));
|
||||
assert_eq!(variants.pop_first(), Some(IdCategory::VoiceConversionResult));
|
||||
assert_eq!(variants.pop_first(), Some(IdCategory::ZeroShotTtsResult));
|
||||
|
||||
@@ -30,6 +30,9 @@ pub enum MediaFileOriginModelType {
|
||||
|
||||
#[serde(rename = "vall_e_x")]
|
||||
VallEX,
|
||||
|
||||
#[serde(rename = "rerender")]
|
||||
Rerender,
|
||||
}
|
||||
|
||||
// TODO(bt, 2022-12-21): This desperately needs MySQL integration tests!
|
||||
@@ -45,7 +48,8 @@ impl MediaFileOriginModelType {
|
||||
Self::SadTalker => "sad_talker",
|
||||
Self::SoVitsSvc => "so_vits_svc",
|
||||
Self::Tacotron2 => "tacotron2",
|
||||
Self::VallEX => "vall_e_x"
|
||||
Self::VallEX => "vall_e_x",
|
||||
Self::Rerender => "rerender",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +60,7 @@ impl MediaFileOriginModelType {
|
||||
"so_vits_svc" => Ok(Self::SoVitsSvc),
|
||||
"tacotron2" => Ok(Self::Tacotron2),
|
||||
"vall_e_x" => Ok(Self::VallEX),
|
||||
"rerender" => Ok(Self::Rerender),
|
||||
_ => Err(format!("invalid value: {:?}", value)),
|
||||
}
|
||||
}
|
||||
@@ -68,7 +73,8 @@ impl MediaFileOriginModelType {
|
||||
Self::SadTalker,
|
||||
Self::SoVitsSvc,
|
||||
Self::Tacotron2,
|
||||
Self::VallEX
|
||||
Self::VallEX,
|
||||
Self::Rerender,
|
||||
])
|
||||
}
|
||||
}
|
||||
@@ -93,6 +99,7 @@ mod tests {
|
||||
assert_eq!(MediaFileOriginModelType::SoVitsSvc.to_str(), "so_vits_svc");
|
||||
assert_eq!(MediaFileOriginModelType::Tacotron2.to_str(), "tacotron2");
|
||||
assert_eq!(MediaFileOriginModelType::VallEX.to_str(), "vall_e_x");
|
||||
assert_eq!(MediaFileOriginModelType::Rerender.to_str(), "rerender");
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -102,18 +109,20 @@ mod tests {
|
||||
assert_eq!(MediaFileOriginModelType::from_str("so_vits_svc").unwrap(), MediaFileOriginModelType::SoVitsSvc);
|
||||
assert_eq!(MediaFileOriginModelType::from_str("tacotron2").unwrap(), MediaFileOriginModelType::Tacotron2);
|
||||
assert_eq!(MediaFileOriginModelType::from_str("vall_e_x").unwrap(), MediaFileOriginModelType::VallEX);
|
||||
assert_eq!(MediaFileOriginModelType::from_str("rerender").unwrap(), MediaFileOriginModelType::Rerender);
|
||||
assert!(MediaFileOriginModelType::from_str("foo").is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn all_variants() {
|
||||
let mut variants = MediaFileOriginModelType::all_variants();
|
||||
assert_eq!(variants.len(), 5);
|
||||
assert_eq!(variants.len(), 6);
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::RvcV2));
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::SadTalker));
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::SoVitsSvc));
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::Tacotron2));
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::VallEX));
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginModelType::Rerender));
|
||||
assert_eq!(variants.pop_first(), None);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,10 @@ pub enum MediaFileOriginProductCategory {
|
||||
/// Media files created by (or uploaded for) the Zero Shot voice product.
|
||||
#[serde(rename = "zs_voice")]
|
||||
ZeroShotVoice,
|
||||
|
||||
// Media files for video filters
|
||||
#[serde(rename = "video_filter")]
|
||||
VideoFilter,
|
||||
}
|
||||
|
||||
// TODO(bt, 2022-12-21): This desperately needs MySQL integration tests!
|
||||
@@ -54,6 +58,7 @@ impl MediaFileOriginProductCategory {
|
||||
Self::Unknown => "unknown",
|
||||
Self::VoiceConversion => "voice_conversion",
|
||||
Self::ZeroShotVoice => "zs_voice",
|
||||
Self::VideoFilter => "video_filter",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +69,7 @@ impl MediaFileOriginProductCategory {
|
||||
"unknown" => Ok(Self::Unknown),
|
||||
"voice_conversion" => Ok(Self::VoiceConversion),
|
||||
"zs_voice" => Ok(Self::ZeroShotVoice),
|
||||
"video_filter" => Ok(Self::VideoFilter),
|
||||
_ => Err(format!("invalid value: {:?}", value)),
|
||||
}
|
||||
}
|
||||
@@ -74,6 +80,7 @@ impl MediaFileOriginProductCategory {
|
||||
BTreeSet::from([
|
||||
Self::FaceAnimator,
|
||||
Self::TextToSpeech,
|
||||
Self::VideoFilter,
|
||||
Self::Unknown,
|
||||
Self::VoiceConversion,
|
||||
Self::ZeroShotVoice,
|
||||
@@ -96,6 +103,7 @@ mod tests {
|
||||
assert_serialization(MediaFileOriginProductCategory::Unknown, "unknown");
|
||||
assert_serialization(MediaFileOriginProductCategory::VoiceConversion, "voice_conversion");
|
||||
assert_serialization(MediaFileOriginProductCategory::ZeroShotVoice, "zs_voice");
|
||||
assert_serialization(MediaFileOriginProductCategory::VideoFilter, "video_filter")
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -105,6 +113,7 @@ mod tests {
|
||||
assert_eq!(MediaFileOriginProductCategory::Unknown.to_str(), "unknown");
|
||||
assert_eq!(MediaFileOriginProductCategory::VoiceConversion.to_str(), "voice_conversion");
|
||||
assert_eq!(MediaFileOriginProductCategory::ZeroShotVoice.to_str(), "zs_voice");
|
||||
assert_eq!(MediaFileOriginProductCategory::VideoFilter.to_str(), "video_filter");
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -114,17 +123,19 @@ mod tests {
|
||||
assert_eq!(MediaFileOriginProductCategory::from_str("unknown").unwrap(), MediaFileOriginProductCategory::Unknown);
|
||||
assert_eq!(MediaFileOriginProductCategory::from_str("voice_conversion").unwrap(), MediaFileOriginProductCategory::VoiceConversion);
|
||||
assert_eq!(MediaFileOriginProductCategory::from_str("zs_voice").unwrap(), MediaFileOriginProductCategory::ZeroShotVoice);
|
||||
assert_eq!(MediaFileOriginProductCategory::from_str("video_filter").unwrap(), MediaFileOriginProductCategory::VideoFilter);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn all_variants() {
|
||||
let mut variants = MediaFileOriginProductCategory::all_variants();
|
||||
assert_eq!(variants.len(), 5);
|
||||
assert_eq!(variants.len(), 6);
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginProductCategory::FaceAnimator));
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginProductCategory::TextToSpeech));
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginProductCategory::Unknown));
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginProductCategory::VoiceConversion));
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginProductCategory::ZeroShotVoice));
|
||||
assert_eq!(variants.pop_first(), Some(MediaFileOriginProductCategory::VideoFilter));
|
||||
assert_eq!(variants.pop_first(), None);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ pub mod media_uploads;
|
||||
pub mod model_categories;
|
||||
pub mod trending_model_analytics;
|
||||
pub mod tts_models;
|
||||
pub mod user_bookmarks;
|
||||
pub mod user_ratings;
|
||||
pub mod voice_conversion_models;
|
||||
pub mod voice_conversion_results;
|
||||
@@ -19,4 +20,3 @@ pub mod model_weights;
|
||||
pub mod tts_render_tasks;
|
||||
pub mod web_rendition_targets;
|
||||
pub mod web_scraping_targets;
|
||||
pub mod favorites;
|
||||
|
||||
@@ -7,7 +7,7 @@ use strum::EnumIter;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
#[cfg_attr(test, derive(EnumIter, EnumCount))]
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd, Deserialize, Serialize,ToSchema)]
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd, Deserialize, Serialize, ToSchema)]
|
||||
pub enum WeightsType {
|
||||
#[serde(rename = "hifigan_tt2")]
|
||||
HifiganTacotron2,
|
||||
@@ -106,7 +106,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_all_variants() {
|
||||
let variants = WeightsType::all_variants();
|
||||
assert_eq!(variants.len(), 7);
|
||||
assert_eq!(variants.len(), 8);
|
||||
assert!(variants.contains(&WeightsType::HifiganTacotron2));
|
||||
assert!(variants.contains(&WeightsType::RvcV2));
|
||||
assert!(variants.contains(&WeightsType::StableDiffusion15));
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
pub mod user_bookmark_entity_type;
|
||||
@@ -0,0 +1,128 @@
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
#[cfg(test)]
|
||||
use strum::EnumCount;
|
||||
#[cfg(test)]
|
||||
use strum::EnumIter;
|
||||
|
||||
/// Used in the `user_bookmarks` table in a `VARCHAR(32)` field named `entity_type`.
|
||||
#[cfg_attr(test, derive(EnumIter, EnumCount))]
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Hash, Deserialize, Serialize)]
|
||||
pub enum UserBookmarkEntityType {
|
||||
/// User
|
||||
#[serde(rename = "user")]
|
||||
User,
|
||||
|
||||
/// TTS model (architecture does not matter)
|
||||
#[serde(rename = "tts_model")]
|
||||
TtsModel,
|
||||
|
||||
/// TTS result (architecture does not matter)
|
||||
#[serde(rename = "tts_result")]
|
||||
TtsResult,
|
||||
|
||||
/// W2L template
|
||||
#[serde(rename = "w2l_template")]
|
||||
W2lTemplate,
|
||||
|
||||
/// W2L result
|
||||
#[serde(rename = "w2l_result")]
|
||||
W2lResult,
|
||||
|
||||
/// MediaFile
|
||||
#[serde(rename = "media_file")]
|
||||
MediaFile,
|
||||
|
||||
/// VoiceConversionModel
|
||||
#[serde(rename = "voice_conversion_model")]
|
||||
VoiceConversionModel,
|
||||
|
||||
/// ZsVoice
|
||||
#[serde(rename = "zs_voice")]
|
||||
ZsVoice,
|
||||
}
|
||||
|
||||
// TODO(bt, 2023-01-17): This desperately needs MySQL integration tests!
|
||||
impl_enum_display_and_debug_using_to_str!(UserBookmarkEntityType);
|
||||
impl_mysql_enum_coders!(UserBookmarkEntityType);
|
||||
|
||||
/// NB: Legacy API for older code.
|
||||
impl UserBookmarkEntityType {
|
||||
pub fn to_str(&self) -> &'static str {
|
||||
match self {
|
||||
Self::User => "user",
|
||||
Self::TtsModel => "tts_model",
|
||||
Self::TtsResult => "tts_result",
|
||||
Self::W2lTemplate => "w2l_template",
|
||||
Self::W2lResult => "w2l_result",
|
||||
Self::MediaFile => "media_file",
|
||||
Self::VoiceConversionModel => "voice_conversion_model",
|
||||
Self::ZsVoice => "zs_voice",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_str(value: &str) -> Result<Self, String> {
|
||||
match value {
|
||||
"user" => Ok(Self::User),
|
||||
"tts_model" => Ok(Self::TtsModel),
|
||||
"tts_result" => Ok(Self::TtsResult),
|
||||
"w2l_template" => Ok(Self::W2lTemplate),
|
||||
"w2l_result" => Ok(Self::W2lResult),
|
||||
"media_file" => Ok(Self::MediaFile),
|
||||
"voice_conversion_model" => Ok(Self::VoiceConversionModel),
|
||||
"zs_voice" => Ok(Self::ZsVoice),
|
||||
_ => Err(format!("invalid value: {:?}", value)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::by_table::user_bookmarks::user_bookmark_entity_type::UserBookmarkEntityType;
|
||||
use crate::test_helpers::assert_serialization;
|
||||
|
||||
mod serde {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_serialization() {
|
||||
assert_serialization(UserBookmarkEntityType::User, "user");
|
||||
assert_serialization(UserBookmarkEntityType::TtsModel, "tts_model");
|
||||
assert_serialization(UserBookmarkEntityType::TtsResult, "tts_result");
|
||||
assert_serialization(UserBookmarkEntityType::W2lTemplate, "w2l_template");
|
||||
assert_serialization(UserBookmarkEntityType::W2lResult, "w2l_result");
|
||||
assert_serialization(UserBookmarkEntityType::MediaFile, "media_file");
|
||||
assert_serialization(UserBookmarkEntityType::VoiceConversionModel, "voice_conversion_model");
|
||||
assert_serialization(UserBookmarkEntityType::ZsVoice, "zs_voice");
|
||||
}
|
||||
}
|
||||
|
||||
mod impl_methods {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_to_str() {
|
||||
assert_eq!(UserBookmarkEntityType::User.to_str(), "user");
|
||||
assert_eq!(UserBookmarkEntityType::TtsModel.to_str(), "tts_model");
|
||||
assert_eq!(UserBookmarkEntityType::TtsResult.to_str(), "tts_result");
|
||||
assert_eq!(UserBookmarkEntityType::W2lTemplate.to_str(), "w2l_template");
|
||||
assert_eq!(UserBookmarkEntityType::W2lResult.to_str(), "w2l_result");
|
||||
assert_eq!(UserBookmarkEntityType::MediaFile.to_str(), "media_file");
|
||||
assert_eq!(UserBookmarkEntityType::VoiceConversionModel.to_str(), "voice_conversion_model");
|
||||
assert_eq!(UserBookmarkEntityType::ZsVoice.to_str(), "zs_voice");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_from_str() {
|
||||
assert_eq!(UserBookmarkEntityType::from_str("user").unwrap(), UserBookmarkEntityType::User);
|
||||
assert_eq!(UserBookmarkEntityType::from_str("tts_model").unwrap(), UserBookmarkEntityType::TtsModel);
|
||||
assert_eq!(UserBookmarkEntityType::from_str("tts_result").unwrap(), UserBookmarkEntityType::TtsResult);
|
||||
assert_eq!(UserBookmarkEntityType::from_str("w2l_template").unwrap(), UserBookmarkEntityType::W2lTemplate);
|
||||
assert_eq!(UserBookmarkEntityType::from_str("w2l_result").unwrap(), UserBookmarkEntityType::W2lResult);
|
||||
assert_eq!(UserBookmarkEntityType::from_str("media_file").unwrap(), UserBookmarkEntityType::MediaFile);
|
||||
assert_eq!(UserBookmarkEntityType::from_str("voice_conversion_model").unwrap(), UserBookmarkEntityType::VoiceConversionModel);
|
||||
assert_eq!(UserBookmarkEntityType::from_str("zs_voice").unwrap(), UserBookmarkEntityType::ZsVoice);
|
||||
assert!(UserBookmarkEntityType::from_str("foo").is_err());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,9 @@ path = "src/lib.rs"
|
||||
# Internal
|
||||
# (none)
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
chrono = { version = "0.4.22", features = ["serde"] }
|
||||
|
||||
@@ -26,7 +29,6 @@ serde_derive = "1.0.125"
|
||||
|
||||
# MySql Database
|
||||
sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
# Test serialization
|
||||
|
||||
@@ -13,6 +13,13 @@ name = "tokens"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
|
||||
# Internal
|
||||
# (none)
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# Serialization
|
||||
serde = "1.0.125"
|
||||
serde_derive = "1.0.125"
|
||||
@@ -22,7 +29,6 @@ rand = "0.8.5"
|
||||
|
||||
sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
|
||||
sqlx-core = { version = "0.7.2" }
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
utoipa = { version = "4", features = ["chrono","actix_extras"] }
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ pub(crate) enum TokenPrefix {
|
||||
Comment,
|
||||
DownloadJob,
|
||||
EmailSenderJob,
|
||||
Favorite,
|
||||
InferenceJob,
|
||||
MediaFile,
|
||||
MediaUpload,
|
||||
@@ -36,6 +35,7 @@ pub(crate) enum TokenPrefix {
|
||||
PasswordReset,
|
||||
TtsRenderTask, // NB: aichatbot / sqlite
|
||||
User,
|
||||
UserBookmark,
|
||||
UserSession,
|
||||
VoiceConversionModel,
|
||||
VoiceConversionResult,
|
||||
@@ -94,7 +94,6 @@ impl PrefixGenerator for TokenPrefix {
|
||||
Self::DownloadJob => "jdown_", // NB: Previously "JGUP:"
|
||||
Self::EmailSenderJob => "email_job_",
|
||||
Self::InferenceJob => "jinf_",
|
||||
Self::Favorite => "fav_",
|
||||
Self::MediaFile => "m_",
|
||||
Self::MediaUpload => "mu_",
|
||||
Self::ModelWeight => "weight_",
|
||||
@@ -102,6 +101,7 @@ impl PrefixGenerator for TokenPrefix {
|
||||
Self::PasswordReset => "pw_reset_",
|
||||
Self::TtsRenderTask => "tts_task_",
|
||||
Self::User => "user_", // NB: Previously "U:"
|
||||
Self::UserBookmark => "ub_",
|
||||
Self::UserSession => "session_",
|
||||
Self::VoiceConversionModel => "vcm_",
|
||||
Self::VoiceConversionResult => "vcr_",
|
||||
|
||||
@@ -34,4 +34,4 @@ pub mod w2l_templates;
|
||||
pub mod zs_voice_dataset_samples;
|
||||
pub mod zs_voice_datasets;
|
||||
pub mod zs_voices;
|
||||
pub mod favorites;
|
||||
pub mod user_bookmarks;
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@ use crate::prefixes::TokenPrefix;
|
||||
/// The primary key for Audit Logs.
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, sqlx::Type, Debug, Serialize, Deserialize)]
|
||||
#[sqlx(transparent)]
|
||||
pub struct FavoriteToken(pub String);
|
||||
pub struct UserBookmarkToken(pub String);
|
||||
|
||||
impl_string_token!(FavoriteToken);
|
||||
impl_crockford_generator!(FavoriteToken, 32usize, TokenPrefix::Favorite, CrockfordLower);
|
||||
impl_string_token!(UserBookmarkToken);
|
||||
impl_crockford_generator!(UserBookmarkToken, 32usize, TokenPrefix::UserBookmark, CrockfordLower);
|
||||
@@ -18,6 +18,9 @@ path = "src/main.rs"
|
||||
container_common = { path = "../../lib/deprecated/container_common" }
|
||||
easyenv = { path = "../../lib/easyenv" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
anyhow = "1.0.75"
|
||||
# TODO/NB: Commenting out clap4 as it prevents windows builds
|
||||
@@ -28,4 +31,3 @@ log = "0.4.14"
|
||||
# Serialization
|
||||
serde = "1.0.125"
|
||||
serde_derive = "1.0.125"
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
@@ -18,6 +18,9 @@ path = "src/main.rs"
|
||||
container_common = { path = "../../lib/deprecated/container_common" }
|
||||
easyenv = { path = "../../lib/easyenv" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
anyhow = "1.0.75"
|
||||
# TODO/NB: Commenting out clap4 as it prevents windows builds
|
||||
@@ -28,4 +31,3 @@ log = "0.4.14"
|
||||
# Serialization
|
||||
serde = "1.0.125"
|
||||
serde_derive = "1.0.125"
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
@@ -28,18 +28,20 @@ mysql_queries = { path = "../../lib/mysql_queries" }
|
||||
storyteller_root = { path = "../../lib/storyteller_root" }
|
||||
tokens = { path = "../../_types/tokens" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
log = "0.4.14"
|
||||
clap = "2.34.0" # TODO: This is really out of date, but has conflicts when updated
|
||||
|
||||
# Runtime
|
||||
# NB: We switched to Tokio from `async-std` for broader ecosystem support.
|
||||
tokio = { version = "1.6.0", features = ["macros"] }
|
||||
tokio = { version = "1.34.0", features = ["macros"] }
|
||||
|
||||
sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
|
||||
|
||||
elasticsearch = "8.5.0-alpha.1"
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
# None yet
|
||||
|
||||
@@ -8,6 +8,7 @@ use errors::AnyhowResult;
|
||||
use crate::bucket_clients::get_bucket_clients;
|
||||
use crate::cli_args::parse_cli_args;
|
||||
use crate::seeding::model_weights::seed_weights;
|
||||
use crate::seeding::seed_media_files::seed_media_files;
|
||||
use crate::seeding::tts_tacotron2::seed_tts_tacotron2;
|
||||
use crate::seeding::users::seed_user_accounts;
|
||||
use crate::seeding::voice_conversion::seed_voice_conversion;
|
||||
@@ -52,6 +53,7 @@ pub async fn main() -> AnyhowResult<()> {
|
||||
}
|
||||
|
||||
seed_user_accounts(&pool).await?;
|
||||
seed_media_files(&pool, maybe_bucket_clients.as_ref()).await?;
|
||||
seed_zero_shot_tts(&pool, maybe_bucket_clients.as_ref()).await?;
|
||||
seed_voice_conversion(&pool).await?;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
pub mod model_weights;
|
||||
pub mod seed_media_files;
|
||||
pub mod tts_tacotron2;
|
||||
pub mod users;
|
||||
pub mod voice_conversion;
|
||||
pub mod zero_shot_tts;
|
||||
pub mod model_weights;
|
||||
pub mod zero_shot_tts;
|
||||
@@ -1,24 +1,22 @@
|
||||
use std::vec;
|
||||
|
||||
use buckets::public::media_files::original_file;
|
||||
use log::info;
|
||||
use sqlx::{MySql, Pool};
|
||||
|
||||
use tokens::tokens::users::UserToken;
|
||||
use sqlx::{ MySql, Pool };
|
||||
use enums::by_table::model_weights::{
|
||||
weights_types::{WeightsType, self},
|
||||
weights_category::{WeightsCategory, self},
|
||||
weights_category::WeightsCategory,
|
||||
weights_types::WeightsType,
|
||||
};
|
||||
use errors::{ anyhow, AnyhowResult };
|
||||
use enums::common::visibility::Visibility;
|
||||
use errors::{anyhow, AnyhowResult};
|
||||
use mysql_queries::queries::model_weights::create_weight::{create_weight, CreateModelWeightsArgs};
|
||||
use mysql_queries::queries::users::user::get_user_token_by_username::get_user_token_by_username;
|
||||
use tokens::tokens::model_weights::ModelWeightToken;
|
||||
use tokens::tokens::users::UserToken;
|
||||
|
||||
use crate::seeding::users::HANASHI_USERNAME;
|
||||
use mysql_queries::queries::model_weights::create_weight::{ create_weight, CreateModelWeightsArgs };
|
||||
use tokens::tokens::model_weights::ModelWeightToken;
|
||||
use enums::common::visibility::Visibility;
|
||||
|
||||
use mysql_queries::queries::users::user::get_user_token_by_username::get_user_token_by_username;
|
||||
|
||||
pub async fn seed_weights_for_paging( mysql_pool: &Pool<MySql>,user_token: UserToken) -> AnyhowResult<()> {
|
||||
pub async fn seed_weights_for_paging(mysql_pool: &Pool<MySql>, user_token: UserToken) -> AnyhowResult<()> {
|
||||
let sd1_5_markdown_description = r#"
|
||||
# Dragonfruit AI Models Update and Workflow
|
||||
|
||||
@@ -83,9 +81,7 @@ pub async fn seed_weights_for_paging( mysql_pool: &Pool<MySql>,user_token: User
|
||||
*Thank you for your continued support and feedback!*
|
||||
"#;
|
||||
|
||||
let sd1_5_image_token = "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/be706282-2978-42a0-aaa2-73881aad94e9/width=1024/00049-2287632957-1girl,face,curly%20hair,red%20hair,white%20background,.jpeg";
|
||||
|
||||
let user_token = user_token;
|
||||
let sd1_5_image_token = "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/be706282-2978-42a0-aaa2-73881aad94e9/width=1024/00049-2287632957-1girl,face,curly%20hair,red%20hair,white%20background,.jpeg";
|
||||
|
||||
// create a loop that loops from 1 to 100
|
||||
for i in 1..=100 {
|
||||
@@ -326,8 +322,8 @@ let sd1_5_image_token = "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/be7062
|
||||
let args = CreateModelWeightsArgs {
|
||||
token: &model_weight_token, // replace with actual ModelWeightToken
|
||||
weights_type: weights_types, // replace with actual WeightsType
|
||||
weights_category: weights_category, // replace with actual WeightsCategory
|
||||
title: title,
|
||||
weights_category, // replace with actual WeightsCategory
|
||||
title,
|
||||
maybe_thumbnail_token: Some(thumbnail_token.to_string()),
|
||||
description_markdown: description,
|
||||
description_rendered_html: description_rendered_html.to_string(),
|
||||
@@ -342,11 +338,11 @@ let sd1_5_image_token = "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/be7062
|
||||
private_bucket_hash: "bucket_hash1".to_string(),
|
||||
maybe_private_bucket_prefix: Some(private_bucket_prefix),
|
||||
maybe_private_bucket_extension: Some(private_bucket_extension),
|
||||
cached_user_ratings_total_count: cached_user_ratings_total_count,
|
||||
cached_user_ratings_positive_count: cached_user_ratings_positive_count,
|
||||
cached_user_ratings_negative_count: cached_user_ratings_negative_count,
|
||||
cached_user_ratings_total_count,
|
||||
cached_user_ratings_positive_count,
|
||||
cached_user_ratings_negative_count,
|
||||
maybe_cached_user_ratings_ratio: Some(cached_user_ratings_ratio as f32),
|
||||
version: version,
|
||||
version,
|
||||
mysql_pool: &mysql_pool, // replace with actual MySqlPool
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,224 @@
|
||||
use std::path::Path;
|
||||
|
||||
use log::{info, warn};
|
||||
use sqlx::{MySql, Pool};
|
||||
|
||||
use buckets::public::media_files::bucket_file_path::MediaFileBucketPath;
|
||||
use enums::by_table::media_files::media_file_type::MediaFileType;
|
||||
use enums::common::visibility::Visibility;
|
||||
use errors::AnyhowResult;
|
||||
use filesys::file_read_bytes::file_read_bytes;
|
||||
use filesys::file_size::file_size;
|
||||
use filesys::path_to_string::path_to_string;
|
||||
use hashing::sha256::sha256_hash_file::sha256_hash_file;
|
||||
use mimetypes::mimetype_for_bytes::get_mimetype_for_bytes;
|
||||
use mimetypes::mimetype_for_file::get_mimetype_for_file;
|
||||
use mysql_queries::queries::media_files::get_media_file::get_media_file;
|
||||
use mysql_queries::queries::media_files::insert_media_file_from_cli_tool::{insert_media_file_from_cli_tool, InsertArgs};
|
||||
use storyteller_root::get_seed_tool_data_root;
|
||||
use tokens::tokens::media_files::MediaFileToken;
|
||||
use tokens::tokens::users::UserToken;
|
||||
|
||||
use crate::bucket_clients::BucketClients;
|
||||
use crate::seeding::users::HANASHI_USER_TOKEN;
|
||||
|
||||
pub async fn seed_media_files(mysql_pool: &Pool<MySql>, maybe_bucket_clients: Option<&BucketClients>) -> AnyhowResult<()> {
|
||||
info!("Seeding media files...");
|
||||
|
||||
// NB: This is idempotent and will only install the media files once.
|
||||
// Delete the records if you want to re-seed.
|
||||
let media_files = [
|
||||
// Audio
|
||||
(HANASHI_USER_TOKEN, "m_21jxt406aattq2cna1xtgf5m4mjyyr", MediaFileType::Audio, "media/audio/voice-samples/biden.wav"),
|
||||
(HANASHI_USER_TOKEN, "m_cxzabpxf88h10rshqraksxbqmhs41h", MediaFileType::Audio, "media/audio/voice-samples/brandon1.wav"),
|
||||
(HANASHI_USER_TOKEN, "m_sq2vhrrmmbr079afk21543aa2jg53g", MediaFileType::Audio, "media/audio/voice-samples/brandon2.wav"),
|
||||
(HANASHI_USER_TOKEN, "m_s61a8g3jnddr3xdg3gctsjxxk9jwja", MediaFileType::Audio, "media/audio/voice-samples/elon.wav"),
|
||||
(HANASHI_USER_TOKEN, "m_e59fh75g76pvebx4qe4r4aymd93q30", MediaFileType::Audio, "media/audio/voice-samples/goku.wav"),
|
||||
(HANASHI_USER_TOKEN, "m_ttq0ym8ht4v0z87zqz27fhadp0743c", MediaFileType::Audio, "media/audio/voice-samples/hillary.wav"),
|
||||
(HANASHI_USER_TOKEN, "m_300bv6f141hv553fjf287p5gb76k37", MediaFileType::Audio, "media/audio/voice-samples/mario_impersonator.wav"),
|
||||
(HANASHI_USER_TOKEN, "m_rd1ey2jem8a37r3vna2h9mht6zevs5", MediaFileType::Audio, "media/audio/voice-samples/rick.wav"),
|
||||
(HANASHI_USER_TOKEN, "m_8n5epqfvs2vh60khap0s3ezem4epkc", MediaFileType::Audio, "media/audio/voice-samples/trump.wav"),
|
||||
(HANASHI_USER_TOKEN, "m_g6dpwcpq51e6kvmpbbkdvgxfan9k1k", MediaFileType::Audio, "media/audio/voice-samples/trump_tts.wav"),
|
||||
// Images
|
||||
(HANASHI_USER_TOKEN, "m_cn5t6ywm9k1ge9qzzxst5krc5tm08m", MediaFileType::Image, "media/image/face-animator-inputs/bill.jpg"),
|
||||
(HANASHI_USER_TOKEN, "m_nf9xebrr8hd1bxkfy7src5k8nv2dzy", MediaFileType::Image, "media/image/face-animator-inputs/elon.jpg"),
|
||||
(HANASHI_USER_TOKEN, "m_t17zh2r3ahs485b8m7c9q502cs6jqh", MediaFileType::Image, "media/image/face-animator-inputs/ernest.jpg"),
|
||||
(HANASHI_USER_TOKEN, "m_vms09sby8tyw742y2s66a4w8f0w278", MediaFileType::Image, "media/image/face-animator-inputs/link.jpg"),
|
||||
(HANASHI_USER_TOKEN, "m_s1z9krfzrscy92jgq3sxhpx1n4vxvc", MediaFileType::Image, "media/image/face-animator-inputs/ripley.jpg"),
|
||||
(HANASHI_USER_TOKEN, "m_we7mnzbd76g4yn19dm6m53er0pjvew", MediaFileType::Image, "media/image/face-animator-inputs/san.png"),
|
||||
(HANASHI_USER_TOKEN, "m_wahwz92nxxfg0x42dw9fdrhwq30yk0", MediaFileType::Image, "media/image/face-animator-inputs/zelda.jpg"),
|
||||
// Video
|
||||
(HANASHI_USER_TOKEN, "m_gedarcfdkxx3zv8zz2wmwsnc1r8jbp", MediaFileType::Video, "media/video/storyteller-studio-renders/girl-rotating-room.mp4"),
|
||||
(HANASHI_USER_TOKEN, "m_3s74yyd4jwrjdp17yx1694n29jv5gr", MediaFileType::Video, "media/video/storyteller-studio-renders/hanashi-run.mp4"),
|
||||
(HANASHI_USER_TOKEN, "m_p6d64gm1wawz25bmdahfded3366b9f", MediaFileType::Video, "media/video/storyteller-studio-renders/mocap-kiss.mp4"),
|
||||
(HANASHI_USER_TOKEN, "m_szp2c77z6je965k44vc22xn9432a88", MediaFileType::Video, "media/video/storyteller-studio-renders/rotating-mocap-girl.mp4"),
|
||||
(HANASHI_USER_TOKEN, "m_mdwspz81zymw9hvmb1d3jm830t25xe", MediaFileType::Video, "media/video/storyteller-studio-renders/rotating-mocap-m.mp4"),
|
||||
(HANASHI_USER_TOKEN, "m_prcs6xkm8phs5y4a2dfwemwjy6n6z3", MediaFileType::Video, "media/video/storyteller-studio-renders/rotating-run-girl.mp4"),
|
||||
(HANASHI_USER_TOKEN, "m_5j889dzw08vn9pbrscx1sncff43ekp", MediaFileType::Video, "media/video/storyteller-studio-renders/rotating-run-jww.mp4"),
|
||||
(HANASHI_USER_TOKEN, "m_fwm2w6wbssez274ayz6x8ta0h1a9qp", MediaFileType::Video, "media/video/storyteller-studio-renders/rotating-run-pascal.mp4"),
|
||||
(HANASHI_USER_TOKEN, "m_yqqkrt2srep6a35xg78114jn9epwg1", MediaFileType::Video, "media/video/storyteller-studio-renders/rotating-run-pop.mp4"),
|
||||
(HANASHI_USER_TOKEN, "m_m4r043kez14pm6vaamsecpz8fafh7g", MediaFileType::Video, "media/video/video-style-transfer/man-explaining.mp4"),
|
||||
(HANASHI_USER_TOKEN, "m_81gq3hygqvrahg6ncxbtcpjap4f9nv", MediaFileType::Video, "media/video/video-style-transfer/woman-gradient-background.mp4"),
|
||||
(HANASHI_USER_TOKEN, "m_dp9ykj3yasjx69g2fx2bpd26wwjz0f", MediaFileType::Video, "media/video/video-style-transfer/woman-red-hair.mp4"),
|
||||
];
|
||||
|
||||
let seed_tool_data_root = get_seed_tool_data_root();
|
||||
|
||||
for (user_token, media_file_token, media_file_type, subdirectory_path) in media_files {
|
||||
let user_token = UserToken::new_from_str(user_token);
|
||||
let media_file_token = MediaFileToken::new_from_str(media_file_token);
|
||||
|
||||
let mut media_file_path = seed_tool_data_root.clone();
|
||||
media_file_path.push(subdirectory_path);
|
||||
|
||||
let result = seed_model(
|
||||
&mysql_pool,
|
||||
&media_file_token,
|
||||
&user_token,
|
||||
media_file_type,
|
||||
&media_file_path,
|
||||
maybe_bucket_clients,
|
||||
).await;
|
||||
|
||||
match result {
|
||||
Ok(_) => info!("Seeded {:?}", media_file_path),
|
||||
Err(err) => warn!(r#"
|
||||
Could not seed media file {} , {:?} : {:?}
|
||||
(No worries: if there's a duplicate key error, we probably already
|
||||
seeded the media file on a previous invocation!)
|
||||
"#, media_file_token, subdirectory_path, err),
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn seed_model(
|
||||
mysql_pool: &Pool<MySql>,
|
||||
media_file_token: &MediaFileToken,
|
||||
user_token: &UserToken,
|
||||
media_file_type: MediaFileType,
|
||||
media_file_path: &Path,
|
||||
maybe_bucket_clients: Option<&BucketClients>,
|
||||
) -> AnyhowResult<()> {
|
||||
info!("Seeding Media file {:?} ...", media_file_path);
|
||||
|
||||
let mut bucket_hash = "NOT_UPLOADED_BY_SEED_TOOL".to_string();
|
||||
let mut maybe_bucket_prefix = None;
|
||||
let mut maybe_bucket_extension = None;
|
||||
|
||||
if media_file_exists(mysql_pool, media_file_token).await? {
|
||||
info!("Media file already seeded: {:?}", media_file_token);
|
||||
return Ok(())
|
||||
}
|
||||
|
||||
if let Some(bucket_clients) = maybe_bucket_clients {
|
||||
let bucket_details = seed_file_to_bucket(media_file_path, bucket_clients).await?;
|
||||
bucket_hash = bucket_details.bucket_hash;
|
||||
maybe_bucket_prefix = bucket_details.maybe_bucket_prefix;
|
||||
maybe_bucket_extension = bucket_details.maybe_bucket_extension;
|
||||
}
|
||||
|
||||
let maybe_mime_type = get_mimetype_for_file(media_file_path)?;
|
||||
let file_size_bytes = file_size(media_file_path)?;
|
||||
let sha256_checksum = sha256_hash_file(media_file_path)?;
|
||||
|
||||
let maybe_filename = media_file_path
|
||||
.file_name()
|
||||
.map(|name| name.to_str())
|
||||
.flatten();
|
||||
|
||||
insert_media_file_from_cli_tool(InsertArgs {
|
||||
pool: &mysql_pool,
|
||||
maybe_use_apriori_media_token: Some(media_file_token),
|
||||
media_file_type,
|
||||
maybe_mime_type,
|
||||
file_size_bytes,
|
||||
sha256_checksum: &sha256_checksum,
|
||||
maybe_origin_filename: maybe_filename,
|
||||
maybe_creator_user_token: Some(user_token),
|
||||
creator_set_visibility: Visibility::Public,
|
||||
public_bucket_directory_hash: &bucket_hash,
|
||||
maybe_public_bucket_prefix: maybe_bucket_prefix.as_deref(),
|
||||
maybe_public_bucket_extension: maybe_bucket_extension.as_deref(),
|
||||
}).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn media_file_exists(
|
||||
mysql_pool: &Pool<MySql>,
|
||||
media_file_token: &MediaFileToken,
|
||||
) -> AnyhowResult<bool> {
|
||||
|
||||
const CAN_SEE_DELETED : bool = true;
|
||||
|
||||
let maybe_file = get_media_file(
|
||||
&media_file_token,
|
||||
CAN_SEE_DELETED,
|
||||
mysql_pool
|
||||
).await?;
|
||||
|
||||
Ok(maybe_file.is_some())
|
||||
}
|
||||
|
||||
struct BucketDetails {
|
||||
bucket_hash: String,
|
||||
maybe_bucket_prefix: Option<String>,
|
||||
maybe_bucket_extension: Option<String>,
|
||||
}
|
||||
|
||||
async fn seed_file_to_bucket(
|
||||
media_file_path: &Path,
|
||||
bucket_clients: &BucketClients,
|
||||
) -> AnyhowResult<BucketDetails> {
|
||||
|
||||
info!("Uploading media file {:?} ...", media_file_path);
|
||||
|
||||
let maybe_bucket_prefix = Some("fakeyou_");
|
||||
|
||||
let maybe_bucket_extension = media_file_path
|
||||
.extension()
|
||||
.map(|extension| extension.to_str())
|
||||
.flatten();
|
||||
|
||||
let bucket_location = MediaFileBucketPath::generate_new(maybe_bucket_prefix, maybe_bucket_extension);
|
||||
|
||||
let bucket_path = path_to_string(bucket_location.to_full_object_pathbuf());
|
||||
|
||||
info!("Reading media file: {:?}", media_file_path);
|
||||
|
||||
let bytes = file_read_bytes(media_file_path)?;
|
||||
let mimetype = get_mimetype_for_bytes(&bytes).unwrap_or("application/octet-stream");
|
||||
|
||||
info!("Uploading media file to bucket path: {:?}", bucket_path);
|
||||
|
||||
let _r = bucket_clients.public.upload_file_with_content_type(
|
||||
&bucket_path,
|
||||
bytes.as_ref(),
|
||||
mimetype
|
||||
).await?;
|
||||
|
||||
Ok(BucketDetails {
|
||||
bucket_hash: bucket_location.get_object_hash().to_string(),
|
||||
maybe_bucket_prefix: maybe_bucket_prefix.map(|s| s.to_string()),
|
||||
maybe_bucket_extension: maybe_bucket_extension.map(|s| s.to_string()),
|
||||
})
|
||||
}
|
||||
|
||||
// Temporary "test" to generate random tokens.
|
||||
// #[cfg(test)]
|
||||
// mod tests {
|
||||
// use tokens::tokens::media_files::MediaFileToken;
|
||||
//
|
||||
// #[test]
|
||||
// fn test() {
|
||||
// // Print some randomly sampled tokens
|
||||
// for _i in 0..50 {
|
||||
// let token = MediaFileToken::generate();
|
||||
// println!("Token: {}", token);
|
||||
// }
|
||||
// // Deliberately fail the test to get the output
|
||||
// assert_eq!(1, 2);
|
||||
// }
|
||||
// }
|
||||
@@ -1,7 +1,7 @@
|
||||
use log::info;
|
||||
use sqlx::{MySql, Pool};
|
||||
|
||||
use buckets::public::media_files::original_file::MediaFileBucketPath;
|
||||
use buckets::public::media_files::bucket_file_path::MediaFileBucketPath;
|
||||
use cloud_storage::bucket_client::BucketClient;
|
||||
use enums::by_table::media_files::media_file_origin_category::MediaFileOriginCategory;
|
||||
use enums::by_table::media_uploads::media_upload_type::MediaUploadType;
|
||||
|
||||
@@ -25,16 +25,18 @@ mimetypes = { path = "../../lib/files/mimetypes" }
|
||||
mysql_queries = { path = "../../lib/mysql_queries" }
|
||||
tokens = { path = "../../_types/tokens" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
clap = "2.34.0" # TODO: This is really out of date, but has conflicts when updated
|
||||
log = "0.4.14"
|
||||
|
||||
# Runtime
|
||||
# NB: We switched to Tokio from `async-std` for broader ecosystem support.
|
||||
tokio = { version = "1.6.0", features = ["macros"] }
|
||||
tokio = { version = "1.34.0", features = ["macros"] }
|
||||
|
||||
sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
# None yet
|
||||
|
||||
@@ -3,7 +3,7 @@ use std::time::Duration;
|
||||
use log::info;
|
||||
use sqlx::mysql::MySqlPoolOptions;
|
||||
|
||||
use buckets::public::media_files::original_file::MediaFileBucketPath;
|
||||
use buckets::public::media_files::bucket_file_path::MediaFileBucketPath;
|
||||
use cloud_storage::bucket_client::BucketClient;
|
||||
use config::shared_constants::{DEFAULT_MYSQL_CONNECTION_STRING, DEFAULT_RUST_LOG};
|
||||
use enums::by_table::media_files::media_file_type::MediaFileType;
|
||||
@@ -119,10 +119,12 @@ pub async fn main() -> AnyhowResult<()> {
|
||||
|
||||
let (media_file_token, _id) = insert_media_file_from_cli_tool(InsertArgs {
|
||||
pool: &pool,
|
||||
maybe_use_apriori_media_token: None,
|
||||
media_file_type,
|
||||
maybe_mime_type,
|
||||
file_size_bytes: 0, // TODO
|
||||
sha256_checksum: "", // TODO
|
||||
maybe_origin_filename: None,
|
||||
maybe_creator_user_token: None,
|
||||
creator_set_visibility,
|
||||
public_bucket_directory_hash: public_upload_path.get_object_hash(),
|
||||
|
||||
@@ -24,6 +24,9 @@ mysql_queries = { path = "../../lib/mysql_queries" }
|
||||
storyteller_root = { path = "../../lib/storyteller_root" }
|
||||
tokens = { path = "../../_types/tokens" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
log = "0.4.14"
|
||||
clap = "2.34.0" # TODO: This is really out of date, but has conflicts when updated
|
||||
@@ -31,7 +34,7 @@ strum = { version = "0.25", features = ["derive"] }
|
||||
|
||||
# Runtime
|
||||
# NB: We switched to Tokio from `async-std` for broader ecosystem support.
|
||||
tokio = { version = "1.6.0", features = ["macros"] }
|
||||
tokio = { version = "1.34.0", features = ["macros"] }
|
||||
|
||||
sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
|
||||
|
||||
@@ -41,7 +44,6 @@ elasticsearch = "8.5.0-alpha.1"
|
||||
serde = "1.0.125"
|
||||
serde_derive = "1.0.125"
|
||||
serde_json = "1.0.108"
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
# None yet
|
||||
|
||||
@@ -18,12 +18,14 @@ config = { path = "../../lib/deprecated/config" }
|
||||
easyenv = { path = "../../lib/easyenv" }
|
||||
errors = { path = "../../lib/errors" }
|
||||
|
||||
# Workspace hack (faster compile yytimes)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
log = "0.4.20"
|
||||
once_cell = "1.18.0"
|
||||
rand = "0.8.5"
|
||||
regex = "1.10.0"
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# Async Runtime
|
||||
# NB: Not using Tokio here since everything is blocking so far.
|
||||
|
||||
@@ -17,10 +17,12 @@ path = "src/main.rs"
|
||||
errors = { path = "../../lib/errors" }
|
||||
logging = { path = "../../lib/logging" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
clap = { version = "4.4.7", features = ["derive"] }
|
||||
walkdir = "2.4.0"
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
# None yet
|
||||
|
||||
@@ -18,7 +18,9 @@ path = "src/main.rs"
|
||||
errors = { path = "../../lib/errors" }
|
||||
web_scrapers = { path = "../../lib/web_scrapers" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
clap = "2.34.0" # TODO: This is really out of date, but has conflicts when updated
|
||||
tokio = { version = "1.6.0", features = ["macros"] }
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
tokio = { version = "1.34.0", features = ["macros"] }
|
||||
|
||||
@@ -17,6 +17,9 @@ path = "src/lib.rs"
|
||||
# Internal
|
||||
errors = { path = "../../lib/errors" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# Actix
|
||||
actix-http = "3.4.0"
|
||||
actix-rt = "2.9.0"
|
||||
@@ -34,7 +37,6 @@ futures-util = "0.3.29"
|
||||
# Serialization
|
||||
serde = "1.0.125"
|
||||
serde_json = "1.0.108"
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
# None yet
|
||||
|
||||
@@ -17,6 +17,9 @@ path = "src/lib.rs"
|
||||
# Internal
|
||||
buckets = { path = "../../../_types/buckets" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
anyhow = "1.0.75"
|
||||
log = "0.4.14"
|
||||
@@ -27,5 +30,4 @@ rust-s3 = { version = "0.33.0" }
|
||||
|
||||
# Runtime
|
||||
# NB: We switched to Tokio from `async-std` for broader ecosystem support.
|
||||
tokio = { version = "1.6.0", features = ["macros"] }
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
tokio = { version = "1.34.0", features = ["macros"] }
|
||||
|
||||
@@ -18,9 +18,11 @@ path = "src/lib.rs"
|
||||
container_common = { path = "../../deprecated/container_common" }
|
||||
subprocess_common = { path = "../../subprocess_common" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
anyhow = "1.0.75"
|
||||
log = "0.4.14"
|
||||
tempdir = "0.3.7"
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@ path = "src/lib.rs"
|
||||
container_common = { path = "../../deprecated/container_common" }
|
||||
easyenv = { path = "../../easyenv" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
anyhow = "1.0.75"
|
||||
once_cell = "1.18.0"
|
||||
@@ -31,4 +34,3 @@ twitch_oauth2 = "0.6.0-rc.2"
|
||||
# Serialization
|
||||
serde = "1.0.125"
|
||||
serde_derive = "1.0.125"
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
@@ -19,11 +19,13 @@ easyenv = { path = "../easyenv" }
|
||||
errors = { path = "../errors" }
|
||||
server_environment = { path = "../server_environment" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
dotenv = "0.15.0"
|
||||
hostname = "0.3.1"
|
||||
log = "0.4.14"
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
# None yet
|
||||
|
||||
@@ -17,9 +17,11 @@ path = "src/lib.rs"
|
||||
# Internal
|
||||
errors = { path = "../../errors" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
anyhow = "1.0.75"
|
||||
|
||||
# In-memory caching
|
||||
lru_time_cache = "0.11.11"
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
@@ -16,6 +16,9 @@ path = "src/lib.rs"
|
||||
# Internal
|
||||
errors = { path = "../../errors" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
# Redis Database
|
||||
r2d2_redis = "0.14.0"
|
||||
|
||||
@@ -23,7 +26,6 @@ r2d2_redis = "0.14.0"
|
||||
serde = "1.0.125"
|
||||
serde_derive = "1.0.125"
|
||||
serde_json = "1.0.108"
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
# None yet
|
||||
|
||||
@@ -16,6 +16,8 @@ path = "src/lib.rs"
|
||||
[dependencies]
|
||||
# Internal
|
||||
errors = { path = "../errors" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
|
||||
@@ -14,6 +14,9 @@ path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
# Internal
|
||||
# (None yet)
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
|
||||
@@ -17,11 +17,13 @@ path = "src/lib.rs"
|
||||
# Internal
|
||||
errors = { path = "../errors" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
hmac = "0.10.0" # jwt signing
|
||||
jwt = "0.13.0"
|
||||
sha2 = "0.9.5" # hmac signing
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
# None yet
|
||||
|
||||
@@ -15,8 +15,14 @@ name = "crockford"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
rand = "0.8.5"
|
||||
# Internal
|
||||
# (None yet)
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
rand = "0.8.5"
|
||||
|
||||
[dev-dependencies]
|
||||
# None yet
|
||||
|
||||
@@ -13,9 +13,15 @@ name = "datetimes"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
# Internal
|
||||
# (None yet)
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
chrono = { version = "0.4.22", features = ["serde"] }
|
||||
once_cell = "1.18.0"
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
# (none)
|
||||
@@ -18,7 +18,9 @@ path = "src/lib.rs"
|
||||
# Internal
|
||||
easyenv = { path = "../../../lib/easyenv" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
anyhow = "1.0.75"
|
||||
url = "2.4.1"
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
@@ -3,11 +3,16 @@
|
||||
use crate::is_bad_download_url::is_bad_download_url;
|
||||
|
||||
/// Reports if the URL is inappropriate for downloading as a TTS model, vocoder, etc.
|
||||
/// DEPRECATE:
|
||||
pub fn is_bad_tts_model_download_url(url: &str) -> anyhow::Result<bool> {
|
||||
// TODO: Just use this.
|
||||
is_bad_download_url(url)
|
||||
}
|
||||
|
||||
pub fn is_bad_model_weights_download_url(url: &str) -> anyhow::Result<bool> {
|
||||
is_bad_download_url(url)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::bad_urls::is_bad_tts_model_download_url;
|
||||
|
||||
@@ -21,10 +21,12 @@ rand = "0.8.5"
|
||||
uuid = { version = "0.8.2", features = ["v4"] }
|
||||
log = "0.4.14"
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
# Serialization
|
||||
serde = { version = "1.0.125", features = ["derive"] }
|
||||
toml = "0.5.8"
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@ path = "src/lib.rs"
|
||||
errors = { path = "../../errors" }
|
||||
reusable_types = { path = "../../../_types/reusable_types" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
anyhow = "1.0.75"
|
||||
base64 = "0.21.0"
|
||||
@@ -39,7 +42,6 @@ language-tags = "0.3.2" # Parsing single tags richly
|
||||
serde = "1.0.125"
|
||||
serde_derive = "1.0.125"
|
||||
serde_json = "1.0.108"
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
actix-rt = "2.9.0"
|
||||
|
||||
@@ -16,11 +16,13 @@ path = "src/lib.rs"
|
||||
# Internal
|
||||
storyteller_root = { path = "../storyteller_root" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
dotenv = "0.15.0"
|
||||
env_logger = "0.10.1"
|
||||
log = "0.4.14"
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
# None yet
|
||||
|
||||
@@ -27,7 +27,7 @@ pub async fn search_tts_models(
|
||||
|
||||
let mut response_json = search_response.json::<Value>().await?;
|
||||
|
||||
let mut hits = response_json.get_mut("hits")
|
||||
let hits = response_json.get_mut("hits")
|
||||
.map(|hits| hits.take());
|
||||
|
||||
let hits = hits.map(|mut hits| {
|
||||
|
||||
@@ -10,6 +10,12 @@ path = "src/lib.rs"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
# Internal
|
||||
errors = { path = "../errors" }
|
||||
lettre = "0.11.2"
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
lettre = "0.11.2"
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ path = "src/lib.rs"
|
||||
# Consider the dependencies here wisely.
|
||||
# Ideally we have almost nothing as a dependency of this crate.
|
||||
anyhow = "1.0.75"
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@@ -18,9 +18,11 @@ path = "src/lib.rs"
|
||||
# Internal
|
||||
errors = { path = "../../errors" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
zip = "0.6.6"
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
# None yet
|
||||
|
||||
@@ -16,11 +16,14 @@ path = "src/lib.rs"
|
||||
[dependencies]
|
||||
# Internal
|
||||
errors = { path = "../../errors" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
log = "0.4.20"
|
||||
|
||||
# External
|
||||
# KEEP THIS TO A MINIMUM OR NIL.
|
||||
log = "0.4.20"
|
||||
|
||||
|
||||
[dev-dependencies]
|
||||
# None yet
|
||||
|
||||
@@ -17,12 +17,14 @@ path = "src/lib.rs"
|
||||
# Internal
|
||||
errors = { path = "../../errors" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
bcrypt = "0.8" # password hashes
|
||||
data-encoding = "2.3.2"
|
||||
md-5 = "0.9.1" # DO NOT USE FOR SERIOUS CRYPTO (we use this for gravatar)
|
||||
ring = "0.17.0-alpha.10"
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
# None yet
|
||||
|
||||
@@ -19,9 +19,11 @@ path = "src/lib.rs"
|
||||
# Internal
|
||||
errors = { path = "../../errors" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
image = "0.24.1"
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
testing = { path = "../../testing" }
|
||||
|
||||
@@ -17,6 +17,9 @@ path = "src/lib.rs"
|
||||
# Internal
|
||||
errors = { path = "../../errors" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
log = "0.4.14"
|
||||
|
||||
@@ -26,7 +29,5 @@ log = "0.4.14"
|
||||
# Opus is the browser's default (only) recording codec: https://blog.addpipe.com/audio-constraints-getusermedia/
|
||||
symphonia = { git = "https://github.com/pdeljanov/Symphonia.git", rev = "e1a70095c4409478c1ded499fb8dd4afa540fb90", features = ["aac", "alac", "flac", "isomp4", "mkv", "mp3", "ogg", "opus", "vorbis", "wav"] }
|
||||
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
# None yet
|
||||
|
||||
@@ -14,9 +14,12 @@ name = "mimetypes"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
infer = "0.11" # Mimetype detection
|
||||
my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
|
||||
|
||||
|
||||
[dev-dependencies]
|
||||
# None yet
|
||||
|
||||
@@ -17,9 +17,11 @@ path = "src/lib.rs"
|
||||
# errors = { path = "../../lib/errors" }
|
||||
# (None yet)
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
uuid = { version = "0.8.2", features = ["v4"] }
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
# None yet
|
||||
|
||||
@@ -22,9 +22,11 @@ container_common = { path = "../deprecated/container_common" }
|
||||
errors = { path = "../errors" }
|
||||
redis_common = { path = "../redis_common" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
anyhow = "1.0.75"
|
||||
chrono = { version = "0.4.22", features = ["serde"] }
|
||||
log = "0.4.14"
|
||||
r2d2_redis = "0.14.0"
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
@@ -14,10 +14,16 @@ name = "logging"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
# Internal
|
||||
# (None yet)
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
dotenv = "0.15.0"
|
||||
env_logger = "0.10.1"
|
||||
log = "0.4.20"
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
[dev-dependencies]
|
||||
# None yet
|
||||
|
||||
@@ -23,6 +23,9 @@ errors = { path = "../errors" }
|
||||
reusable_types = { path = "../../_types/reusable_types" }
|
||||
tokens = { path = "../../_types/tokens" }
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
# External
|
||||
anyhow = "1.0.75"
|
||||
chrono = { version = "0.4.22", features = ["serde"] }
|
||||
@@ -40,9 +43,8 @@ serde_json = "1.0.108"
|
||||
toml = "0.5.8"
|
||||
serial_test = "2.0.0"
|
||||
|
||||
tokio = { version = "1.6.0", features = ["full"] }
|
||||
tokio = { version = "1.34.0", features = ["full"] }
|
||||
rand = "0.8"
|
||||
sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
|
||||
|
||||
my-workspace-hack = { version = "0.1", path = "../../my-workspace-hack" }
|
||||
|
||||
|
||||
+10
@@ -3,6 +3,7 @@ use errors::AnyhowResult;
|
||||
|
||||
use crate::payloads::generic_inference_args::lipsync_payload::LipsyncArgs;
|
||||
use crate::payloads::generic_inference_args::tts_payload::TTSArgs;
|
||||
use crate::payloads::generic_inference_args::videofilter_payload::{RerenderArgs};
|
||||
|
||||
|
||||
/// Used to encode extra state for the `generic_inference_jobs` table.
|
||||
@@ -35,6 +36,10 @@ pub enum InferenceCategoryAbbreviated {
|
||||
#[serde(rename = "vc")] // NB: DO NOT CHANGE. It could break live jobs. Renamed to be fewer bytes.
|
||||
#[serde(alias = "voice_conversion")]
|
||||
VoiceConversion,
|
||||
|
||||
#[serde(rename = "vf")] // NB: DO NOT CHANGE. It could break live jobs. Renamed to be fewer bytes.
|
||||
#[serde(alias = "video_filter")]
|
||||
VideoFilter,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, Copy, Debug)]
|
||||
@@ -84,6 +89,9 @@ pub enum PolymorphicInferenceArgs {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
transpose: Option<i32>,
|
||||
},
|
||||
|
||||
/// Rerender a video. (Short name to save space when serializing.)
|
||||
Rr(RerenderArgs)
|
||||
}
|
||||
|
||||
|
||||
@@ -104,6 +112,7 @@ impl InferenceCategoryAbbreviated {
|
||||
InferenceCategory::LipsyncAnimation => Self::LipsyncAnimation,
|
||||
InferenceCategory::TextToSpeech => Self::TextToSpeech,
|
||||
InferenceCategory::VoiceConversion => Self::VoiceConversion,
|
||||
InferenceCategory::VideoFilter => Self::VideoFilter,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +121,7 @@ impl InferenceCategoryAbbreviated {
|
||||
Self::LipsyncAnimation => InferenceCategory::LipsyncAnimation,
|
||||
Self::TextToSpeech => InferenceCategory::TextToSpeech,
|
||||
Self::VoiceConversion => InferenceCategory::VoiceConversion,
|
||||
Self::VideoFilter => InferenceCategory::VideoFilter,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
pub mod generic_inference_args;
|
||||
pub mod lipsync_payload;
|
||||
pub mod tts_payload;
|
||||
pub mod tts_payload;
|
||||
pub mod videofilter_payload;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user