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

downloadクレートをdownloaderクレートに #648

Merged
merged 5 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 1 addition & 1 deletion .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ jobs:
run: cargo binstall cargo-edit@^0.11 --no-confirm --log-level debug
- name: set cargo version
run: |
cargo set-version "$VERSION" --exclude voicevox_core_python_api --exclude download --exclude xtask
cargo set-version "$VERSION" --exclude voicevox_core_python_api --exclude downloader --exclude xtask
if ${{ !!matrix.whl_local_version }}; then cargo set-version "$VERSION+"${{ matrix.whl_local_version }} -p voicevox_core_python_api; fi
- name: cache target
uses: Swatinem/rust-cache@v2
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/build_and_deploy_downloader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ on:
paths:
- Cargo.*
- rust-toolchain
- crates/download/**
- crates/downloader/**
- .github/workflows/build_and_deploy_downloader.yml
push:
paths:
- Cargo.*
- rust-toolchain
- crates/download/**
- crates/downloader/**
- .github/workflows/build_and_deploy_downloader.yml

env:
Expand All @@ -46,23 +46,23 @@ jobs:
strategy:
matrix:
include:
- name: download-windows-x64.exe
- name: downloader-windows-x64.exe
target: x86_64-pc-windows-msvc
os: windows-2019

- name: download-linux-x64
- name: downloader-linux-x64
target: x86_64-unknown-linux-gnu
os: ubuntu-20.04

- name: download-linux-arm64
- name: downloader-linux-arm64
target: aarch64-unknown-linux-gnu
os: ubuntu-20.04

- name: download-osx-x64
- name: downloader-osx-x64
target: x86_64-apple-darwin
os: macos-11

- name: download-osx-arm64
- name: downloader-osx-arm64
target: aarch64-apple-darwin
os: macos-11

Expand All @@ -83,15 +83,15 @@ jobs:
targets: ${{ matrix.target }}

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

- name: Rename the binary
run: |
case "$OS" in
Windows) exe_suffix=.exe;;
Linux | macOS) exe_suffix=;;
esac
mv $"target/${{ matrix.target }}/release/download$exe_suffix" ./${{ matrix.name }}
mv $"target/${{ matrix.target }}/release/downloader$exe_suffix" ./${{ matrix.name }}

- name: Code signing (Windows)
if: startsWith(matrix.os, 'windows') && inputs.code_signing
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/download_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
pull_request:
paths:
- "Cargo.*"
- "crates/download/**"
- "crates/downloader/**"
- ".github/workflows/download_test.yml"

env:
Expand All @@ -31,7 +31,7 @@ jobs:
include:
- name: 通常ダウンロード
os: windows-latest
download_command: cargo run -vv -p download -- # バージョン指定のために -- が必要
download_command: cargo run -vv -p downloader -- # バージョン指定のために -- が必要
download_dir: voicevox_core
check_items: |
voicevox_core.dll
Expand All @@ -49,7 +49,7 @@ jobs:
*curand*
- name: CpuArch指定
os: windows-latest
download_command: cargo run -vv -p download -- --cpu-arch x86
download_command: cargo run -vv -p downloader -- --cpu-arch x86
download_dir: voicevox_core
check_items: |
voicevox_core.dll
Expand All @@ -66,7 +66,7 @@ jobs:
*curand*
- name: output先指定ダウンロード
os: windows-latest
download_command: cargo run -vv -p download -- -o other_output
download_command: cargo run -vv -p downloader -- -o other_output
download_dir: other_output
check_items: |
voicevox_core.dll
Expand All @@ -83,7 +83,7 @@ jobs:
*curand*
- name: Min option確認
os: windows-latest
download_command: cargo run -vv -p download -- --min
download_command: cargo run -vv -p downloader -- --min
download_dir: voicevox_core
check_items: |
voicevox_core.dll
Expand All @@ -100,7 +100,7 @@ jobs:
open_jtalk_dic_utf_8-1.11
- name: DirectML option確認
os: windows-latest
download_command: cargo run -vv -p download -- --device directml
download_command: cargo run -vv -p downloader -- --device directml
download_dir: voicevox_core
check_items: |
voicevox_core.dll
Expand All @@ -119,7 +119,7 @@ jobs:
*curand*
- name: DirectMLかつMin option確認
os: windows-latest
download_command: cargo run -vv -p download -- --device directml --min
download_command: cargo run -vv -p downloader -- --device directml --min
download_dir: voicevox_core
check_items: |
voicevox_core.dll
Expand All @@ -137,7 +137,7 @@ jobs:
open_jtalk_dic_utf_8-1.11
- name: cuda option確認
os: windows-latest
download_command: cargo run -vv -p download -- --device cuda
download_command: cargo run -vv -p downloader -- --device cuda
download_dir: voicevox_core
check_items: |
voicevox_core.dll
Expand All @@ -159,7 +159,7 @@ jobs:
*directml*
- name: cudaかつmin option確認
os: windows-latest
download_command: cargo run -vv -p download -- --device cuda --min
download_command: cargo run -vv -p downloader -- --device cuda --min
download_dir: voicevox_core
check_items: |
voicevox_core.dll
Expand Down
2 changes: 1 addition & 1 deletion 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
@@ -1,6 +1,6 @@
[workspace]
members = [
"crates/download",
"crates/downloader",
"crates/test_util",
"crates/voicevox_core",
"crates/voicevox_core_c_api",
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,30 @@ Downloader を用いて環境構築を行う場合
PowerShell で下記コマンドを実行してください

```PowerShell
Invoke-WebRequest https://github.com/VOICEVOX/voicevox_core/releases/latest/download/download-windows-x64.exe -OutFile ./download.exe
./download.exe
Invoke-WebRequest https://github.com/VOICEVOX/voicevox_core/releases/latest/download/downloader-windows-x64.exe -OutFile ./downloader.exe
./downloader.exe
```

### Linux/macOS の場合

[最新のリリース](https://github.com/VOICEVOX/voicevox_core/releases/latest)から環境に合わせてダウンローダーのバイナリをダウンロードしてください。
現在利用可能なのは以下の 4 つです。

- download-linux-arm64
- download-linux-x64
- download-osx-arm64
- download-osx-x64
- downloader-linux-arm64
- downloader-linux-x64
- downloader-osx-arm64
- downloader-osx-x64

以下は Linux の x64 での実行例です。

```bash
binary=download-linux-x64
curl -sSfL https://github.com/VOICEVOX/voicevox_core/releases/latest/download/${binary} -o download
chmod +x download
./download
binary=downloader-linux-x64
curl -sSfL https://github.com/VOICEVOX/voicevox_core/releases/latest/download/${binary} -o downloader
chmod +x downloader
./downloader
```

詳細な Downloader の使い方については [こちら](./docs/downloads/download.md) を参照してください
詳細な Downloader の使い方については [こちら](./docs/downloader.md) を参照してください

<details>
<summary> Downloader を使わない場合</summary>
Expand Down Expand Up @@ -88,13 +88,13 @@ Raspberry Pi 用の ONNX Runtime は以下からダウンロードできます
nvidia 製 GPU を搭載した Windows, Linux PC では CUDA を用いた合成が可能です。

CUDA 版を利用するには Downloader の実行が必要です。
詳細は [CUDA 版をダウンロードする場合](./docs/downloads/download.md#cuda) を参照してください
詳細は [CUDA 版をダウンロードする場合](./docs/downloader.md#cuda) を参照してください

##### DirectML

DirectX12 に対応した GPU を搭載した Windows PC では DirectML を用いた合成が可能です
DirectML 版を利用するには Downloader の実行が必要です。
詳細は [DirectML 版をダウンロードする場合](./docs/downloads/download.md#directml) を参照してください
詳細は [DirectML 版をダウンロードする場合](./docs/downloads/downloader.md#directml) を参照してください

macOS の場合、CUDA の macOS サポートは現在終了しているため、VOICEVOX CORE の macOS 向けコアライブラリも CUDA, CUDNN を利用しない CPU 版のみの提供となります。

Expand Down Expand Up @@ -145,7 +145,7 @@ model フォルダにある onnx モデルはダミーのため、ノイズの
cargo build --release -p voicevox_core_c_api
```

DLL用のヘッダファイルは [crates/voicevox\_core\_c\_api/include/voicevox\_core.h](https://github.com/VOICEVOX/voicevox_core/tree/main/crates/voicevox_core_c_api/include/voicevox_core.h) にあります。
DLL 用のヘッダファイルは [crates/voicevox_core_c_api/include/voicevox_core.h](https://github.com/VOICEVOX/voicevox_core/tree/main/crates/voicevox_core_c_api/include/voicevox_core.h) にあります。
Copy link
Member Author

@Hiroshiba Hiroshiba Oct 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あっ この辺変わっちゃいましたが、ま、まあ。。。


## コアライブラリのテスト

Expand All @@ -156,10 +156,10 @@ cargo test
## ダウンローダーの実行

```bash
cargo run -p download
cargo run -p downloader

# ヘルプを表示
cargo run -p download -- -h
cargo run -p downloader -- -h
```

## ヘッダファイルの更新
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "download"
name = "downloader"
version = "0.0.0"
edition.workspace = true
publish.workspace = true
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ clarify = [
{ name = "ring", version = "0.16", expression = "MIT AND ISC AND OpenSSL", license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }] },

# TODO: `package.license`を書く
{ name = "download", expression = "MIT", license-files = [] },
{ name = "downloader", expression = "MIT", license-files = [] },
{ name = "open_jtalk", expression = "BSD-3-Clause", license-files = [] },
{ name = "open_jtalk-sys", expression = "BSD-3-Clause", license-files = [] },
{ name = "voicevox_core", expression = "MIT", license-files = [] },
Expand Down
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ドキュメントがdocs/downloads/download.mdの1ファイルで、vvm.mddocs直下にあるので、合わせてdownloader.mdを直下に置くようにしてみました。
ドキュメントの整理をする別の機会を設けて、その時に変更しても良いかも・・・?

File renamed without changes.
2 changes: 1 addition & 1 deletion example/cpp/unix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ voicevox_core ライブラリを C++ から使用するサンプルコード (`s

## 必要なファイルの準備

まず、この README があるディレクトリで、[Downloader を使用して voicevox_core をダウンロードします](../../../docs/downloads/download.md#default)。
まず、この README があるディレクトリで、[Downloader を使用して voicevox_core をダウンロードします](../../../docs/downloader.md#default)。

## ビルド

Expand Down
2 changes: 1 addition & 1 deletion example/cpp/windows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Visual Studio Installerを使用しインストールしてください。

出力フォルダを作成するために、一度ビルドします。「windows_example.sln」をVisual Studioで開き、メニューの「ビルド」→「ソリューションのビルド」を押します。
この段階では、ビルドは失敗します。「bin」フォルダと「lib」フォルダが生成されていればOKです。
[Releases](https://github.com/VOICEVOX/voicevox_core/releases/latest)から「voicevox_core-windows-x64-cpu-{バージョン名}.zip」をダウンロードし、展開します。[ダウンローダー](https://github.com/VOICEVOX/voicevox_core/blob/main/docs/downloads/download.md)を使うと便利です。
[Releases](https://github.com/VOICEVOX/voicevox_core/releases/latest)から「voicevox_core-windows-x64-cpu-{バージョン名}.zip」をダウンロードし、展開します。[ダウンローダー](https://github.com/VOICEVOX/voicevox_core/blob/main/docs/downloader.md)を使うと便利です。
展開してできたファイル・フォルダをそれぞれ下記のフォルダへ配置します。

- simple_tts に配置
Expand Down
14 changes: 7 additions & 7 deletions example/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@ https://github.com/VOICEVOX/voicevox_core/releases/latest

linux/mac の場合

download-linux-x64 のところはアーキテクチャや OS によって適宜読み替えてください。
downloader-linux-x64 のところはアーキテクチャや OS によって適宜読み替えてください。
https://github.com/VOICEVOX/voicevox_core/releases/latest#%E3%83%80%E3%82%A6%E3%83%B3%E3%83%AD%E3%83%BC%E3%83%80

```console
❯ binary=download-linux-x64
❯ curl -sSfL https://github.com/VOICEVOX/voicevox_core/releases/latest/download/${binary} -o download
❯ chmod +x download
❯ ./download -o ./example/python
❯ binary=downloader-linux-x64
❯ curl -sSfL https://github.com/VOICEVOX/voicevox_core/releases/latest/download/${binary} -o downloader
❯ chmod +x downloader
❯ ./downloader -o ./example/python
❯ # いくつかのファイルは不要なので消すことができます
❯ #rm -r ./example/python/{model,VERSION,*voicevox_core*}
```

windows の場合

```console
❯ Invoke-WebRequest https://github.com/VOICEVOX/voicevox_core/releases/latest/download/download-windows-x64.exe -OutFile ./download.exe
❯ ./download -o ./example/python
❯ Invoke-WebRequest https://github.com/VOICEVOX/voicevox_core/releases/latest/download/downloader-windows-x64.exe -OutFile ./downloader.exe
❯ ./downloader -o ./example/python
❯ # いくつかのファイルは不要なので消すことができます
❯ #Remove-Item -Recurse ./example/python/model,./example/python/VERSION,./example/python/*voicevox_core*
```
Expand Down
Loading