-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into refactor-make-text-analyzer-pub
- Loading branch information
Showing
27 changed files
with
612 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 116 additions & 0 deletions
116
crates/voicevox_core/src/infer/domains/experimental_talk.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
use std::{collections::BTreeSet, sync::LazyLock}; | ||
|
||
use enum_map::Enum; | ||
use macros::{InferenceInputSignature, InferenceOperation, InferenceOutputSignature}; | ||
use ndarray::{Array0, Array1, Array2}; | ||
|
||
use crate::{manifest::ExperimentalTalkManifest, StyleType}; | ||
|
||
use super::super::{ | ||
InferenceDomain, InferenceInputSignature as _, InferenceOutputSignature as _, OutputTensor, | ||
}; | ||
|
||
pub(crate) enum ExperimentalTalkDomain {} | ||
|
||
impl InferenceDomain for ExperimentalTalkDomain { | ||
type Operation = ExperimentalTalkOperation; | ||
type Manifest = ExperimentalTalkManifest; | ||
|
||
fn style_types() -> &'static BTreeSet<StyleType> { | ||
static STYLE_TYPES: LazyLock<BTreeSet<StyleType>> = | ||
LazyLock::new(|| [StyleType::Talk].into()); | ||
&STYLE_TYPES | ||
} | ||
} | ||
|
||
#[derive(Clone, Copy, Enum, InferenceOperation)] | ||
#[inference_operation( | ||
type Domain = ExperimentalTalkDomain; | ||
)] | ||
pub(crate) enum ExperimentalTalkOperation { | ||
#[inference_operation( | ||
type Input = PredictDurationInput; | ||
type Output = PredictDurationOutput; | ||
)] | ||
PredictDuration, | ||
|
||
#[inference_operation( | ||
type Input = PredictIntonationInput; | ||
type Output = PredictIntonationOutput; | ||
)] | ||
PredictIntonation, | ||
|
||
#[inference_operation( | ||
type Input = GenerateFullIntermediateInput; | ||
type Output = GenerateFullIntermediateOutput; | ||
)] | ||
GenerateFullIntermediate, | ||
|
||
#[inference_operation( | ||
type Input = RenderAudioSegmentInput; | ||
type Output = RenderAudioSegmentOutput; | ||
)] | ||
RenderAudioSegment, | ||
} | ||
|
||
#[derive(InferenceInputSignature)] | ||
#[inference_input_signature( | ||
type Signature = PredictDuration; | ||
)] | ||
pub(crate) struct PredictDurationInput { | ||
pub(crate) phoneme_list: Array1<i64>, | ||
pub(crate) speaker_id: Array1<i64>, | ||
} | ||
|
||
#[derive(InferenceOutputSignature)] | ||
pub(crate) struct PredictDurationOutput { | ||
pub(crate) phoneme_length: Array1<f32>, | ||
} | ||
|
||
#[derive(InferenceInputSignature)] | ||
#[inference_input_signature( | ||
type Signature = PredictIntonation; | ||
)] | ||
pub(crate) struct PredictIntonationInput { | ||
pub(crate) length: Array0<i64>, | ||
pub(crate) vowel_phoneme_list: Array1<i64>, | ||
pub(crate) consonant_phoneme_list: Array1<i64>, | ||
pub(crate) start_accent_list: Array1<i64>, | ||
pub(crate) end_accent_list: Array1<i64>, | ||
pub(crate) start_accent_phrase_list: Array1<i64>, | ||
pub(crate) end_accent_phrase_list: Array1<i64>, | ||
pub(crate) speaker_id: Array1<i64>, | ||
} | ||
|
||
#[derive(InferenceOutputSignature)] | ||
pub(crate) struct PredictIntonationOutput { | ||
pub(crate) f0_list: Array1<f32>, | ||
} | ||
|
||
#[derive(InferenceInputSignature)] | ||
#[inference_input_signature( | ||
type Signature = GenerateFullIntermediate; | ||
)] | ||
pub(crate) struct GenerateFullIntermediateInput { | ||
pub(crate) f0: Array2<f32>, | ||
pub(crate) phoneme: Array2<f32>, | ||
pub(crate) speaker_id: Array1<i64>, | ||
} | ||
|
||
#[derive(InferenceOutputSignature)] | ||
pub(crate) struct GenerateFullIntermediateOutput { | ||
pub(crate) spec: Array2<f32>, | ||
} | ||
|
||
#[derive(InferenceInputSignature)] | ||
#[inference_input_signature( | ||
type Signature = RenderAudioSegment; | ||
)] | ||
pub(crate) struct RenderAudioSegmentInput { | ||
pub(crate) spec: Array2<f32>, | ||
} | ||
|
||
#[derive(InferenceOutputSignature)] | ||
pub(crate) struct RenderAudioSegmentOutput { | ||
pub(crate) wave: Array1<f32>, | ||
} |
Oops, something went wrong.