From 70c2341afd92ada354290fcfae76ee79ff5a7925 Mon Sep 17 00:00:00 2001 From: Masato Kikuchi Date: Mon, 31 Mar 2025 23:35:51 +0900 Subject: [PATCH] format --- crates/sbv2_core/src/tts.rs | 3 ++- crates/sbv2_core/src/tts_util.rs | 2 +- crates/sbv2_editor/src/main.rs | 13 +++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/crates/sbv2_core/src/tts.rs b/crates/sbv2_core/src/tts.rs index be7c9fd..83d8c1a 100644 --- a/crates/sbv2_core/src/tts.rs +++ b/crates/sbv2_core/src/tts.rs @@ -383,7 +383,8 @@ impl TTSModelHolder { if t.is_empty() { continue; } - let (bert_ori, phones, tones, lang_ids) = self.parse_text_neo(t.to_string(), given_tones.clone())?; + let (bert_ori, phones, tones, lang_ids) = + self.parse_text_neo(t.to_string(), given_tones.clone())?; let vits2 = self .find_model(ident)? diff --git a/crates/sbv2_core/src/tts_util.rs b/crates/sbv2_core/src/tts_util.rs index 97b69c6..a5569f6 100644 --- a/crates/sbv2_core/src/tts_util.rs +++ b/crates/sbv2_core/src/tts_util.rs @@ -210,4 +210,4 @@ pub fn kata_tone2phone_tone(kata_tone: Vec<(String, i32)>) -> Vec<(String, i32)> } results.push(("_".to_string(), 0)); results -} \ No newline at end of file +} diff --git a/crates/sbv2_editor/src/main.rs b/crates/sbv2_editor/src/main.rs index a3b6995..5e79ffb 100644 --- a/crates/sbv2_editor/src/main.rs +++ b/crates/sbv2_editor/src/main.rs @@ -1,13 +1,17 @@ use axum::extract::State; use axum::{ extract::Query, + http::header::CONTENT_TYPE, response::IntoResponse, routing::{get, post}, Json, Router, - http::header::CONTENT_TYPE, }; use sbv2_core::tts_util::kata_tone2phone_tone; -use sbv2_core::{jtalk::JTalk, tts::{TTSModelHolder, SynthesizeOptions}, tts_util::preprocess_parse_text}; +use sbv2_core::{ + jtalk::JTalk, + tts::{SynthesizeOptions, TTSModelHolder}, + tts_util::preprocess_parse_text, +}; use serde::{Deserialize, Serialize}; use tokio::{fs, net::TcpListener, sync::Mutex}; @@ -75,10 +79,7 @@ async fn synthesis( .map(|query| (query.kana.clone(), query.tone)) .collect::>(); let phone_tone = kata_tone2phone_tone(phone_tone); - let tones = phone_tone - .iter() - .map(|(_, tone)| *tone) - .collect::>(); + let tones = phone_tone.iter().map(|(_, tone)| *tone).collect::>(); let buffer = { let mut tts_model = state.tts_model.lock().await; tts_model.easy_synthesize_neo(