From 9b9962ed29fb5cbbea7258c6250d83d3f00b12b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=B3=E3=83=9E=E3=83=AA=E3=83=B3=E8=A6=AA=E8=A1=9B?= =?UTF-8?q?=E9=9A=8A?= Date: Wed, 13 Nov 2024 11:16:24 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Style=20ID=E6=8C=87=E5=AE=9A=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sbv2_api/src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sbv2_api/src/main.rs b/sbv2_api/src/main.rs index 10e936a..fdcf331 100644 --- a/sbv2_api/src/main.rs +++ b/sbv2_api/src/main.rs @@ -40,6 +40,10 @@ fn length_default() -> f32 { 1.0 } +fn style_id_default() -> f32 { + 0 +} + #[derive(Deserialize, ToSchema)] struct SynthesizeRequest { text: String, @@ -48,6 +52,8 @@ struct SynthesizeRequest { sdp_ratio: f32, #[serde(default = "length_default")] length_scale: f32, + #[serde(default = "style_id_default")] + style_id: i32, } #[utoipa::path( @@ -65,6 +71,7 @@ async fn synthesize( ident, sdp_ratio, length_scale, + style_id }): Json, ) -> AppResult { log::debug!("processing request: text={text}, ident={ident}, sdp_ratio={sdp_ratio}, length_scale={length_scale}"); @@ -73,7 +80,7 @@ async fn synthesize( tts_model.easy_synthesize( &ident, &text, - 0, + style_id, SynthesizeOptions { sdp_ratio, length_scale, From 001f61bb6a2041de7575973ccc3b15a8da95133c Mon Sep 17 00:00:00 2001 From: tuna2134 Date: Wed, 13 Nov 2024 02:24:09 +0000 Subject: [PATCH 2/2] fix types --- sbv2_api/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbv2_api/src/main.rs b/sbv2_api/src/main.rs index fdcf331..6a636d2 100644 --- a/sbv2_api/src/main.rs +++ b/sbv2_api/src/main.rs @@ -40,7 +40,7 @@ fn length_default() -> f32 { 1.0 } -fn style_id_default() -> f32 { +fn style_id_default() -> i32 { 0 }