Skip to content

Commit

Permalink
To 0.11.1 (#350)
Browse files Browse the repository at this point in the history
* release-testのcallのバージョン指定の修正 (#347)

* release-testのcallのバージョン指定の修正

* 時間を伸ばした

* ユーザー辞書についての文をreadmeに追加 (#348)

* ユーザ辞書機能について文章を追加

* 見出しを修正

* 改行を追加

* envの代わりにgithubコンテキストを使うよう変更 (#349)

called workflow では caller workflow で定義された env コンテキストの
変数が使えないらしい
cf. https://docs.github.com/ja/actions/using-workflows/reusing-workflows#limitations

* VOICEVOX_CORE_VERSION 0.11.1

Co-authored-by: takana-v <44311840+takana-v@users.noreply.github.com>
Co-authored-by: Gray Suitcase <41382894+PickledChair@users.noreply.github.com>
  • Loading branch information
3 people committed Feb 28, 2022
1 parent 3ac57f0 commit 5840278
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/voicevox_engine
PYTHON_VERSION: "3.8.10"
VOICEVOX_CORE_VERSION: "0.11.0"
VOICEVOX_CORE_VERSION: "0.11.1"
VOICEVOX_ENGINE_VERSION:
|- # releaseのときはタグが、それ以外はlatestがバージョン名に
${{ github.event.release.tag_name != '' && github.event.release.tag_name || 'latest' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/voicevox_engine
PYTHON_VERSION: "3.8.10"
VOICEVOX_RESOURCE_VERSION: "0.11.0"
VOICEVOX_CORE_VERSION: "0.11.0"
VOICEVOX_CORE_VERSION: "0.11.1"
VOICEVOX_ENGINE_VERSION:
|- # releaseのときはタグが、それ以外はlatestがバージョン名に
${{ github.event.release.tag_name != '' && github.event.release.tag_name || 'latest' }}
Expand Down Expand Up @@ -770,5 +770,5 @@ jobs:
needs: [upload-to-release]
uses: ./.github/workflows/release-test.yml
with:
version: ${{ github.ref }} # == github.event.release.tag_name
version: ${{ github.event.release.tag_name }}
repo_url: ${{ format('{0}/{1}', github.server_url, github.repository) }} # このリポジトリのURL
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN <<EOF
EOF

# assert VOICEVOX_CORE_VERSION >= 0.11.0 (ONNX)
ARG VOICEVOX_CORE_VERSION=0.11.0
ARG VOICEVOX_CORE_VERSION=0.11.1
ARG VOICEVOX_CORE_LIBRARY_NAME=libcore_cpu_x64.so
RUN <<EOF
set -eux
Expand Down
77 changes: 77 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,83 @@ curl -s \
> audio.wav
```

### ユーザー辞書機能について

APIからユーザ辞書の参照、単語の追加、編集、削除を行うことができます。

#### 参照

`/user_dict`にGETリクエストを投げることでユーザ辞書の一覧を取得することができます。

```bash
curl -s -X GET "localhost:50021/user_dict"
```

#### 単語追加

`/user_dict_word`にPOSTリクエストを投げる事でユーザ辞書に単語を追加することができます。
URLパラメータとして、以下が必要です。
- surface (辞書に登録する単語)
- pronunciation (カタカナでの読み方)
- accent_type (アクセント核位置、整数)

アクセント核位置については、こちらの文章が参考になるかと思います。
〇型となっている数字の部分がアクセント核位置になります。
https://tdmelodic.readthedocs.io/ja/latest/pages/introduction.html

成功した場合の返り値は単語に割り当てられるUUIDの文字列になります。

```bash
surface="test"
pronunciation="テスト"
accent_type="1"

curl -s -X POST "localhost:50021/user_dict_word" \
--get \
--data-urlencode "surface=$surface" \
--data-urlencode "pronunciation=$pronunciation" \
--data-urlencode "accent_type=$accent_type"
```

#### 単語修正

`/user_dict_word/{word_uuid}`にPUTリクエストを投げる事でユーザ辞書の単語を修正することができます。
URLパラメータとして、以下が必要です。
- surface (辞書に登録するワード)
- pronunciation (カタカナでの読み方)
- accent_type (アクセント核位置、整数)

word_uuidは単語追加時に確認できるほか、ユーザ辞書を参照することでも確認できます。
成功した場合の返り値は`204 No Content`になります。

```bash
surface="test2"
pronunciation="テストツー"
accent_type="2"
# 環境によってword_uuidは適宜書き換えてください
word_uuid="cce59b5f-86ab-42b9-bb75-9fd3407f1e2d"

curl -s -X PUT "localhost:50021/user_dict_word/$word_uuid" \
--get \
--data-urlencode "surface=$surface" \
--data-urlencode "pronunciation=$pronunciation" \
--data-urlencode "accent_type=$accent_type"
```

#### 単語削除

`/user_dict_word/{word_uuid}`にDELETEリクエストを投げる事でユーザ辞書の単語を削除することができます。

word_uuidは単語追加時に確認できるほか、ユーザ辞書を参照することでも確認できます。
成功した場合の返り値は`204 No Content`になります。

```bash
# 環境によってword_uuidは適宜書き換えてください
word_uuid="cce59b5f-86ab-42b9-bb75-9fd3407f1e2d"

curl -s -X DELETE "localhost:50021/user_dict_word/$word_uuid"
```

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

`presets.yaml`を編集することで話者や話速などのプリセットを使うことができます。
Expand Down
2 changes: 1 addition & 1 deletion build_util/check_release_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_release_build(dist_dir: Path) -> None:

# 起動
process = Popen([run_file.absolute()], cwd=dist_dir)
time.sleep(60) # 待機
time.sleep(120) # 待機

# バージョン取得テスト
req = Request(base_url + "version")
Expand Down

0 comments on commit 5840278

Please sign in to comment.