Skip to content

Commit

Permalink
Merge branch 'main' into change-liberate-voicevox-core
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed Nov 27, 2024
2 parents 09ffd63 + a5745c2 commit 21e3e79
Show file tree
Hide file tree
Showing 48 changed files with 1,160 additions and 565 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ jobs:
plain-cdylib) linking=load-onnxruntime ;;
ios-xcframework) linking=link-onnxruntime ;;
esac
cargo build -p voicevox_core_c_api -vv --features "$linking" --target ${{ matrix.target }} --release
cargo build -p voicevox_core_c_api -v --features "$linking" --target ${{ matrix.target }} --release
env:
RUSTFLAGS: -C panic=abort
- name: build voicevox_core_python_api
Expand All @@ -237,7 +237,7 @@ jobs:
echo "whl=$(find ./target/wheels -type f)" >> "$GITHUB_OUTPUT"
- name: build voicevox_core_java_api
if: contains(matrix.target, 'android')
run: cargo build -p voicevox_core_java_api -vv --target ${{ matrix.target }} --release
run: cargo build -p voicevox_core_java_api vv --target ${{ matrix.target }} --release
- name: Organize artifact
run: |
mkdir -p "artifact/${{ env.ASSET_NAME }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_and_deploy_downloader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
targets: ${{ matrix.target }}

- name: Build downloader
run: cargo build -vv --release -p downloader --target ${{ matrix.target }}
run: cargo build -v --release -p downloader --target ${{ matrix.target }}

- name: Rename the binary
run: |
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/download_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
include:
- name: 通常ダウンロード
os: windows-latest
download_command: cargo run -vv -p downloader -- # バージョン指定のために -- が必要
download_command: cargo run -v -p downloader -- # バージョン指定のために -- が必要
download_dir: voicevox_core
check_items: |
voicevox_core.dll
Expand All @@ -51,7 +51,7 @@ jobs:
*curand*
- name: CpuArch指定
os: windows-latest
download_command: cargo run -vv -p downloader -- --cpu-arch x86
download_command: cargo run -v -p downloader -- --cpu-arch x86
download_dir: voicevox_core
check_items: |
voicevox_core.dll
Expand All @@ -68,7 +68,7 @@ jobs:
*curand*
- name: output先指定ダウンロード
os: windows-latest
download_command: cargo run -vv -p downloader -- -o other_output
download_command: cargo run -v -p downloader -- -o other_output
download_dir: other_output
check_items: |
voicevox_core.dll
Expand All @@ -85,7 +85,7 @@ jobs:
*curand*
- name: Min option確認
os: windows-latest
download_command: cargo run -vv -p downloader -- --min
download_command: cargo run -v -p downloader -- --min
download_dir: voicevox_core
check_items: |
voicevox_core.dll
Expand All @@ -102,7 +102,7 @@ jobs:
open_jtalk_dic_utf_8-1.11
- name: DirectML option確認
os: windows-latest
download_command: cargo run -vv -p downloader -- --devices directml
download_command: cargo run -v -p downloader -- --devices directml
download_dir: voicevox_core
check_items: |
voicevox_core.dll
Expand All @@ -121,7 +121,7 @@ jobs:
*curand*
- name: DirectMLかつMin option確認
os: windows-latest
download_command: cargo run -vv -p downloader -- --devices directml --min
download_command: cargo run -v -p downloader -- --devices directml --min
download_dir: voicevox_core
check_items: |
voicevox_core.dll
Expand All @@ -139,7 +139,7 @@ jobs:
open_jtalk_dic_utf_8-1.11
- name: cuda option確認
os: windows-latest
download_command: cargo run -vv -p downloader -- --devices cuda
download_command: cargo run -v -p downloader -- --devices cuda
download_dir: voicevox_core
check_items: |
voicevox_core.dll
Expand All @@ -161,7 +161,7 @@ jobs:
*directml*
- name: cudaかつmin option確認
os: windows-latest
download_command: cargo run -vv -p downloader -- --devices cuda --min
download_command: cargo run -v -p downloader -- --devices cuda --min
download_dir: voicevox_core
check_items: |
voicevox_core.dll
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ jobs:
with:
python-version: "3.8"
- uses: Swatinem/rust-cache@v2
- run: cargo clippy -vv --tests -- -D clippy::all -D warnings --no-deps
- run: cargo clippy -vv -- -D clippy::all -D warnings --no-deps
- run: cargo clippy -vv -p voicevox_core -p voicevox_core_c_api --features link-onnxruntime --tests -- -D clippy::all -D warnings --no-deps
- run: cargo clippy -vv -p voicevox_core -p voicevox_core_c_api --features link-onnxruntime -- -D clippy::all -D warnings --no-deps
- run: cargo clippy -v --tests -- -D clippy::all -D warnings --no-deps
- run: cargo clippy -v -- -D clippy::all -D warnings --no-deps
- run: cargo clippy -v -p voicevox_core -p voicevox_core_c_api --features link-onnxruntime --tests -- -D clippy::all -D warnings --no-deps
- run: cargo clippy -v -p voicevox_core -p voicevox_core_c_api --features link-onnxruntime -- -D clippy::all -D warnings --no-deps
- run: cargo fmt -- --check

rust-unit-test:
Expand All @@ -88,9 +88,9 @@ jobs:
with:
key: "cargo-unit-test-cache"
- name: Run cargo unit test
run: RUST_BACKTRACE=full cargo test --lib --bins -vv -- --include-ignored
run: RUST_BACKTRACE=full cargo test --lib --bins -v -- --include-ignored
- name: Run cargo documentation test
run: RUST_BACKTRACE=full cargo test --doc -vv
run: RUST_BACKTRACE=full cargo test --doc -v

rust-integration-test-strategy-matrix: # 実行対象の条件をフィルタリングする
runs-on: ubuntu-latest
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
with:
key: "cargo-integration-test-cache-${{ matrix.os }}"
- name: Run cargo integration test (load-onnxruntime)
run: RUST_BACKTRACE=full cargo test --test "*" -vv -- --include-ignored
run: RUST_BACKTRACE=full cargo test --test "*" -v -- --include-ignored

c-header:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:
- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall
- name: build voicevox_core_c_api
run: cargo build -p voicevox_core_c_api --features load-onnxruntime -vv
run: cargo build -p voicevox_core_c_api --features load-onnxruntime -v
- name: 必要なfileをunix用exampleのディレクトリに移動させる
run: |
mkdir -p example/cpp/unix/voicevox_core/
Expand Down Expand Up @@ -237,7 +237,7 @@ jobs:
- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall
- name: build voicevox_core_c_api
run: cargo build -p voicevox_core_c_api --features load-onnxruntime -vv
run: cargo build -p voicevox_core_c_api --features load-onnxruntime -v
- name: 必要なfileをexampleのディレクトリに移動させる
shell: bash
run: |
Expand Down Expand Up @@ -281,7 +281,7 @@ jobs:
- run: |
pip install --upgrade poetry
poetry install --with dev --with test
- run: cargo build -p test_util -vv # build scriptにより/crates/test_util/data/の生成
- run: cargo build -p test_util -v # build scriptにより/crates/test_util/data/の生成
- run: poetry run maturin build --locked
- run: poetry run maturin develop --locked
- name: pytestを実行
Expand Down Expand Up @@ -311,8 +311,8 @@ jobs:
distribution: "adopt"
- name: Build
run: |
cargo build -p voicevox_core_java_api -vv
cargo build -p test_util -vv # build scriptにより/crates/test_util/data/の生成
cargo build -p voicevox_core_java_api -v
cargo build -p test_util -v # build scriptにより/crates/test_util/data/の生成
- name: 必要なDLLをコピーしてテストを実行
working-directory: crates/voicevox_core_java_api
run: |
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ zip = "0.6.3"

[workspace.dependencies.voicevox-ort]
git = "https://github.com/VOICEVOX/ort.git"
rev = "3ecf05d66e2e04435fde3c8200e5208ce2707eb7"
rev = "17f741301db0bb08da0eafe8a338e5efd8a4b5df"

[workspace.dependencies.open_jtalk]
git = "https://github.com/VOICEVOX/open_jtalk-rs.git"
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ Issue 側で取り組み始めたことを伝えるか、最初に Draft プル

### Rust 以外の言語の API に関する方針

VOICEVOX CORE の主要機能は Rust で実装されることを前提としており、他の言語のラッパーでのみの機能追加はしない方針としています。これは機能の一貫性を保つための方針です。
各言語の特性に応じた追加実装(例えば、Python での `style_id`[`NewType`](https://docs.python.org/ja/3/library/typing.html#newtype) 化など)は許容されます。
[APIデザイン ガイドライン](./docs/guide/dev/api-design.md)をご覧ください。

## コアライブラリのビルド

Expand Down
29 changes: 29 additions & 0 deletions crates/test_util/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,35 @@ fn generate_example_data_json(dist: &Path) -> anyhow::Result<()> {
phoneme.to_vec()
},
},
intermediate: typing::IntermediateExampleData {
f0_length: 69,
phoneme_size: 45,
feature_dim: 80,
margin_width: 14,
f0_vector: {
let mut f0 = [0.; 69];
f0[9..24].fill(5.905218);
f0[37..60].fill(5.565851);
f0.to_vec()
},
phoneme_vector: {
let mut phoneme = [0.; 45 * 69];
let mut set_one = |index, range| {
for i in range {
phoneme[(i * 45 + index) as usize] = 1.;
}
};
set_one(0, 0..9);
set_one(37, 9..13);
set_one(14, 13..24);
set_one(35, 24..30);
set_one(6, 30..37);
set_one(37, 37..45);
set_one(30, 45..60);
set_one(0, 60..69);
phoneme.to_vec()
},
},
};

fs_err::write(
Expand Down
7 changes: 7 additions & 0 deletions crates/test_util/compatible_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,11 @@ bool yukarin_sa_forward(int64_t length, int64_t *vowel_phoneme_list,
bool decode_forward(int64_t length, int64_t phoneme_size, float *f0,
float *phoneme, int64_t *speaker_id, float *output);

bool generate_full_intermediate(int64_t length, int64_t phoneme_size,
float *f0, float *phoneme, int64_t *speaker_id,
float *output);

bool render_audio_segment(int64_t length, int64_t margin_width, int64_t feature_size,
float *audio_feature, int64_t *speaker_id, float *output);

const char *last_error_message();
11 changes: 11 additions & 0 deletions crates/test_util/src/typing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,22 @@ pub struct DecodeExampleData {
pub phoneme_vector: Vec<f32>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct IntermediateExampleData {
pub f0_length: i64,
pub phoneme_size: i64,
pub feature_dim: i64,
pub margin_width: i64,
pub f0_vector: Vec<f32>,
pub phoneme_vector: Vec<f32>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct ExampleData {
pub speaker_id: i64,

pub duration: DurationExampleData,
pub intonation: IntonationExampleData,
pub decode: DecodeExampleData,
pub intermediate: IntermediateExampleData,
}
Loading

0 comments on commit 21e3e79

Please sign in to comment.