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 Oct 3, 2024
2 parents 0b63929 + 6510a2a commit b1175b2
Show file tree
Hide file tree
Showing 15 changed files with 121 additions and 50 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ rev = "de226a26e8e18edbdb1d6f986afe37bbbf35fbf4"
version = "0.0.0"
edition = "2021"
publish = false
rust-version = "1.81.0"

# min-sized-rustを元にrelease buildのサイズが小さくなるようにした
# https://github.com/johnthagen/min-sized-rust
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

## API

[API ドキュメント](https://voicevox.github.io/voicevox_core/apis/c_api/globals_func.html)をご覧ください。
[API ドキュメント](https://voicevox.github.io/voicevox_core/apis/)をご覧ください。

## ユーザーガイド

Expand Down Expand Up @@ -144,9 +144,9 @@ VOICEVOX CORE の主要機能は Rust で実装されることを前提として

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

[Releases](https://github.com/VOICEVOX/voicevox_core/releases) にあるビルド済みのコアライブラリを利用せず、自分で一からビルドする場合こちらを参照してください。ビルドには [Rust](https://www.rust-lang.org/ja) ([Windows での Rust 開発環境構築手順はこちら](https://docs.microsoft.com/ja-jp/windows/dev-environment/rust/setup)) と [cmake](https://cmake.org/download/) が必要です。

model フォルダにある onnx モデルはダミーのため、ノイズの混じった音声が出力されます
ビルドには [Rust](https://www.rust-lang.org/ja) ([Windows での Rust 開発環境構築手順はこちら](https://docs.microsoft.com/ja-jp/windows/dev-environment/rust/setup)) と [cmake](https://cmake.org/download/) が必要です。
[Releases](https://github.com/VOICEVOX/voicevox_core/releases) にあるビルド済みのコアライブラリを利用せず、自分で一からビルドした場合は、model フォルダにある onnx モデルのみが利用できます。
このモデルはダミーのため、ノイズの混じった音声が出力されます

```bash
# DLLをビルド
Expand Down
1 change: 1 addition & 0 deletions crates/downloader/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "downloader"
edition.workspace = true
rust-version.workspace = true

[[bin]]
name = "download"
Expand Down
1 change: 1 addition & 0 deletions crates/test_util/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "test_util"
edition.workspace = true
rust-version.workspace = true

[dependencies]
libloading.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/voicevox_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "voicevox_core"
version.workspace = true
edition.workspace = true
publish.workspace = true
rust-version.workspace = true

[package.metadata.docs.rs]
features = ["load-onnxruntime", "link-onnxruntime"]
Expand Down
2 changes: 1 addition & 1 deletion crates/voicevox_core/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ impl<R: InferenceRuntime> LoadedModels<R> {
}

fn remove(&mut self, model_id: VoiceModelId) -> Result<()> {
if self.0.remove(&model_id).is_none() {
if self.0.shift_remove(&model_id).is_none() {
return Err(ErrorRepr::ModelNotFound { model_id }.into());
}
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion crates/voicevox_core/src/user_dict/dict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl<A: Async> Inner<A> {
}

fn remove_word(&self, word_uuid: Uuid) -> crate::Result<UserDictWord> {
let Some(word) = self.with_words(|words| words.remove(&word_uuid)) else {
let Some(word) = self.with_words(|words| words.shift_remove(&word_uuid)) else {
return Err(ErrorRepr::WordNotFound(word_uuid).into());
};
Ok(word)
Expand Down
1 change: 1 addition & 0 deletions crates/voicevox_core_c_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "voicevox_core_c_api"
version.workspace = true
edition.workspace = true
publish.workspace = true
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
1 change: 1 addition & 0 deletions crates/voicevox_core_java_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "voicevox_core_java_api"
version.workspace = true
edition.workspace = true
publish.workspace = true
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
1 change: 1 addition & 0 deletions crates/voicevox_core_macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "voicevox_core_macros"
version.workspace = true
edition.workspace = true
publish.workspace = true
rust-version.workspace = true

[lib]
name = "macros"
Expand Down
1 change: 1 addition & 0 deletions crates/voicevox_core_python_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "voicevox_core_python_api"
version = "0.0.0"
edition.workspace = true
publish.workspace = true
rust-version.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
1 change: 1 addition & 0 deletions crates/xtask/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "xtask"
edition.workspace = true
rust-version.workspace = true

[dependencies]
cbindgen.workspace = true
Expand Down
7 changes: 4 additions & 3 deletions docs/apis/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
<meta charset="utf-8" />
</head>
<body>
<!-- TODO: まともなページを用意する -->
<p>TODO: まともなページを用意する</p>
<p><a href="https://github.com/VOICEVOX/voicevox_core/pull/496">VOICEVOX/voicevox_core#496</a></p>
<ul>
<li><a href="./rust_api/voicevox_core">Rust API</a></li>
<li><a href="./c_api">C API</a></li>
<li><a href="./python_api">Python API</a></li>
<li><a href="./c_api/voicevox__core_8h.html">C API</a></li>
<li><a href="./python_api/autoapi/voicevox_core/index.html">Python API</a></li>
<li><a href="./java_api">Java API</a></li>
</ul>
</body>
Expand Down
41 changes: 0 additions & 41 deletions renovate.json

This file was deleted.

102 changes: 102 additions & 0 deletions renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: [
"config:recommended",
],
timezone: "Asia/Tokyo",
separateMajorMinor: false,
dependencyDashboardApproval: true, // 万が一`packageRules`の網羅性に穴ができた場合に備え
packageRules: [
// `separateMajorMinor`を無効化した上で次の二つのgroupにすべてをまとめる。
//
// * "major dependencies" (`renovate/major-dependencies`)
// * "non-major dependencies" (`renovate/non-major-dependencies`)
//
// バージョン0.y.z (y≧1)のyとバージョン0.0.zのzの変更は"major dependencies"の方に含むようにする。

// メジャーバージョンの更新
{
groupName: "major dependencies",
matchUpdateTypes: [
"major",
],
dependencyDashboardApproval: false,
},
{
groupName: "major dependencies",
matchUpdateTypes: [
"minor",
],
matchCurrentVersion: "/^v?0\\./",
dependencyDashboardApproval: false,
},
{
groupName: "major dependencies",
matchUpdateTypes: [
"patch",
],
matchCurrentVersion: "/^v?0\\.0\\./",
dependencyDashboardApproval: false,
},

// メジャーバージョン以外の更新
{
groupName: "non-major dependencies",
matchUpdateTypes: [
"minor",
],
matchCurrentVersion: "!/^v?0\\./",
dependencyDashboardApproval: false,
},
{
groupName: "non-major dependencies",
matchUpdateTypes: [
"patch",
],
matchCurrentVersion: "!/^v?0\\.0\\./",
dependencyDashboardApproval: false,
},

// GHAのrunnerに対しては無効化する
{
matchDatasources: [
"github-runners",
],
matchPackageNames: [
"windows",
"macos",
"ubuntu",
],
enabled: false,
},
],
cargo: {
rangeStrategy: "bump",
},
customManagers: [
{
customType: "regex",
fileMatch: [
"^rust-toolchain$",
],
matchStrings: [
"(?<currentValue>\\d+\\.\\d+\\.\\d+)",
],
depNameTemplate: "Rust",
packageNameTemplate: "rust-lang/rust",
datasourceTemplate: "github-tags",
},
{
customType: "regex",
fileMatch: [
"^Cargo.toml$",
],
matchStrings: [
"rust-version = \"(?<currentValue>\\d+\\.\\d+\\.\\d+)\"",
],
depNameTemplate: "Rust",
packageNameTemplate: "rust-lang/rust",
datasourceTemplate: "github-tags",
},
],
}

0 comments on commit b1175b2

Please sign in to comment.