forked from VOICEVOX/voicevox_core
-
Notifications
You must be signed in to change notification settings - Fork 0
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 feat-rename-exec-execute-to-perform
- Loading branch information
Showing
47 changed files
with
1,141 additions
and
621 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,11 +182,11 @@ jobs: | |
git fetch private refs/tags/${{ env.PRODUCTION_REPOSITORY_TAG }} | ||
git -c user.name=dummy -c [email protected] merge FETCH_HEAD | ||
) > /dev/null 2>&1 | ||
- name: Set up Python 3.8 | ||
- name: Set up Python 3.10 | ||
if: matrix.python_whl | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.8" | ||
python-version: "3.10" | ||
architecture: ${{ contains(matrix.artifact_name,'x86') && 'x86' || 'x64' }} | ||
- name: set up ${{ matrix.target }} | ||
uses: ./.github/actions/rust-toolchain-from-file | ||
|
@@ -225,7 +225,9 @@ jobs: | |
- name: set cargo version | ||
run: | | ||
cargo set-version "$VERSION" --exclude voicevox_core_python_api --exclude downloader --exclude xtask | ||
if ${{ matrix.python_whl }}; then cargo set-version "$VERSION" -p voicevox_core_python_api; fi | ||
if ${{ matrix.python_whl }}; then | ||
sed -i_ 's/version = "\(0\.0\.0\)"/version = "'"$VERSION"'"/' ./crates/voicevox_core_python_api/pyproject.toml | ||
fi | ||
- name: cache target | ||
uses: Swatinem/rust-cache@v2 | ||
if: ${{ !inputs.is_production }} | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mod adjust; | ||
|
||
pub(crate) use self::adjust::{ensure_minimum_phoneme_length, pad_decoder_feature}; |
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,6 @@ | ||
//! 推論操作の前処理と後処理。 | ||
mod post; | ||
mod pre; | ||
|
||
pub(crate) use self::{post::ensure_minimum_phoneme_length, pre::pad_decoder_feature}; |
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,12 @@ | ||
//! 推論の出力の後処理。 | ||
pub(crate) fn ensure_minimum_phoneme_length(mut output: Vec<f32>) -> Vec<f32> { | ||
const PHONEME_LENGTH_MINIMAL: f32 = 0.01; | ||
|
||
for output_item in output.iter_mut() { | ||
if *output_item < PHONEME_LENGTH_MINIMAL { | ||
*output_item = PHONEME_LENGTH_MINIMAL; | ||
} | ||
} | ||
output | ||
} |
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,37 @@ | ||
//! 推論の入力の前処理。 | ||
/// 音が途切れてしまうのを避けるworkaround処理。 | ||
// TODO: 改善したらここのpadding処理を取り除く | ||
pub(crate) fn pad_decoder_feature<const PADDING_FRAME_LENGTH: usize>( | ||
f0: ndarray::Array1<f32>, | ||
phoneme: ndarray::Array2<f32>, | ||
) -> (usize, ndarray::Array1<f32>, ndarray::Array2<f32>) { | ||
let start_and_end_padding_size = 2 * PADDING_FRAME_LENGTH; | ||
let length_with_padding = f0.len() + start_and_end_padding_size; | ||
let f0_with_padding = make_f0_with_padding(f0, PADDING_FRAME_LENGTH); | ||
let phoneme_with_padding = make_phoneme_with_padding(phoneme, PADDING_FRAME_LENGTH); | ||
return (length_with_padding, f0_with_padding, phoneme_with_padding); | ||
|
||
fn make_f0_with_padding( | ||
f0_slice: ndarray::Array1<f32>, | ||
padding_size: usize, | ||
) -> ndarray::Array1<f32> { | ||
// 音が途切れてしまうのを避けるworkaround処理 | ||
// 改善したらこの関数を削除する | ||
let padding = ndarray::Array1::<f32>::zeros(padding_size); | ||
ndarray::concatenate![ndarray::Axis(0), padding, f0_slice, padding] | ||
} | ||
|
||
fn make_phoneme_with_padding( | ||
phoneme_slice: ndarray::Array2<f32>, | ||
padding_size: usize, | ||
) -> ndarray::Array2<f32> { | ||
// 音が途切れてしまうのを避けるworkaround処理 | ||
// 改善したらこの関数を削除する | ||
let mut padding = ndarray::Array2::<f32>::zeros((padding_size, phoneme_slice.ncols())); | ||
padding | ||
.slice_mut(ndarray::s![.., 0]) | ||
.assign(&ndarray::arr0(1.0)); | ||
ndarray::concatenate![ndarray::Axis(0), padding, phoneme_slice, padding] | ||
} | ||
} |
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
Oops, something went wrong.