Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

プリセットファイルの位置をユーザーディレクトリに変更 #1493

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
## Artifact of generating licenses
/licenses.json
licenses_venv/
## Presets
presets.yaml

# Copied from `https://github.com/github/gitignore/blob/main/Python.gitignore` @2022-01-10
# Byte-compiled / optimized / DLL files
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ curl -s -X DELETE "127.0.0.1:50021/user_dict_word/$word_uuid"

### プリセット機能について

`presets.yaml`を編集することでキャラクターや話速などのプリセットを使うことができます。
ユーザーディレクトリに存在する`presets.yaml`を編集することでキャラクターや話速などのプリセットを使うことができます。
takana-v marked this conversation as resolved.
Show resolved Hide resolved

```bash
echo -n "プリセットをうまく活用すれば、サードパーティ間で同じ設定を使うことができます" >text.txt
Expand Down Expand Up @@ -442,7 +442,7 @@ options:
--setting_file SETTING_FILE
設定ファイルを指定できます。
--preset_file PRESET_FILE
プリセットファイルを指定できます。指定がない場合、環境変数 VV_PRESET_FILE、実行ファイルのディレクトリのpresets.yamlを順に探します。
プリセットファイルを指定できます。指定がない場合、環境変数 VV_PRESET_FILE、ユーザーディレクトリのpresets.yamlを順に探します。
--disable_mutable_api
辞書登録や設定変更など、エンジンの静的なデータを変更するAPIを無効化します。指定しない場合、代わりに環境変数 VV_DISABLE_MUTABLE_API の値が使われます。VV_DISABLE_MUTABLE_API の値が1の場合は無効化で、0または空文字、値がない場合は無視されます。
```
Expand Down
4 changes: 2 additions & 2 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def read_cli_arguments(envs: Envs) -> CLIArgs:
default=None,
help=(
"プリセットファイルを指定できます。"
"指定がない場合、環境変数 VV_PRESET_FILE、実行ファイルのディレクトリのpresets.yamlを順に探します。"
"指定がない場合、環境変数 VV_PRESET_FILE、ユーザーディレクトリのpresets.yamlを順に探します。"
),
)

Expand Down Expand Up @@ -360,7 +360,7 @@ def main() -> None:
env_preset_path = Path(envs.env_preset_path)
else:
env_preset_path = None
default_preset_path = engine_root() / "presets.yaml"
default_preset_path = get_save_dir() / "presets.yaml"
preset_path = select_first_not_none(
[args.preset_file, env_preset_path, default_preset_path]
)
Expand Down
2 changes: 1 addition & 1 deletion test/benchmark/engine_preparation.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def _generate_engine_fake_server(root_dir: Path) -> TestClient:
)
tts_engines = make_tts_engines_from_cores(core_manager)
setting_loader = SettingHandler(Path("./not_exist.yaml"))
preset_manager = PresetManager(Path("./presets.yaml"))
preset_manager = PresetManager(get_save_dir() / "presets.yaml")
user_dict = UserDictionary()
engine_manifest = load_manifest(engine_manifest_path())
library_manager = LibraryManager(
Expand Down
8 changes: 2 additions & 6 deletions tools/make_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@
from voicevox_engine.setting.setting_manager import USER_SETTING_PATH, SettingHandler
from voicevox_engine.tts_pipeline.tts_engine import TTSEngineManager
from voicevox_engine.user_dict.user_dict_manager import UserDictionary
from voicevox_engine.utility.path_utility import (
engine_manifest_path,
engine_root,
get_save_dir,
)
from voicevox_engine.utility.path_utility import engine_manifest_path, get_save_dir


def generate_api_docs_html(schema: str) -> str:
Expand Down Expand Up @@ -47,7 +43,7 @@ def generate_api_docs_html(schema: str) -> str:
core_manager.register_core(CoreAdapter(MockCoreWrapper()), "mock")
tts_engines = TTSEngineManager()
tts_engines.register_engine(MockTTSEngine(), "mock")
preset_path = engine_root() / "presets.yaml"
preset_path = get_save_dir() / "presets.yaml"
engine_manifest = load_manifest(engine_manifest_path())
library_manager = LibraryManager(
get_save_dir() / "installed_libraries",
Expand Down