This commit is contained in:
tuna2134
2024-09-10 08:04:23 +00:00
parent fdaa80ea11
commit c5d24203fb
3 changed files with 2 additions and 8 deletions

Binary file not shown.

View File

@@ -25,11 +25,7 @@ pub fn predict(
let output = outputs.get("output").unwrap();
let content = output.try_extract_tensor::<f32>()?.to_owned();
println!("{:?}", content);
let (data, _) = content.clone().into_raw_vec_and_offset();
Ok(Array2::from_shape_vec(
(content.shape()[0], content.shape()[1]),
content.into_raw_vec(),
)
.unwrap())
Ok(Array2::from_shape_vec((content.shape()[0], content.shape()[1]), data).unwrap())
}

View File

@@ -5,12 +5,10 @@ fn main() -> error::Result<()> {
let text = "隣の客はよくかき食う客だ";
let normalized_text = norm::normalize_text(text);
println!("{}", normalized_text);
let jtalk = jtalk::JTalk::new()?;
let (phones, tones, mut word2ph) = jtalk.g2p(&normalized_text)?;
let (phones, tones, lang_ids) = nlp::cleaned_text_to_sequence(phones, tones);
println!("{:?}", phones);
// add black
let phones = utils::intersperse(&phones, 0);