-
Notifications
You must be signed in to change notification settings - Fork 120
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
C APIの改善を行う #217
Merged
Merged
C APIの改善を行う #217
Changes from 4 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
0429477
C APIの改善を行う
qwerty2501 fce9290
Merge branch 'main' of https://github.com/VOICEVOX/voicevox_core into…
qwerty2501 60bc086
C API定義を修正した
qwerty2501 af7a3fe
voicevox_core側の実装も変更した
qwerty2501 466fdd9
cpu_num_threadsをu16に変更した
qwerty2501 b5635cf
helper関数を分離した
qwerty2501 43e2c51
SynthesisOptionsは不要そうだったので削除
qwerty2501 b5cd93e
SynthesisOptionsを追加
qwerty2501 2ece206
decode_forward -> decodeに変更した
qwerty2501 3a80b7e
yukarin_sa_forward -> predict_intonation に変更した
qwerty2501 e3a3469
yukarin_s_forward -> predict_durationに変更
qwerty2501 317d432
とりあえずコンパイル・テストが通るようにした
qwerty2501 911fdd6
clippyのエラーを修正した
qwerty2501 0a5db30
内部のyukarin_s,yukarin_saについて名前を修正
qwerty2501 5fe6665
decode_forwardとなっていたところをdecodeに修正した
qwerty2501 b625954
unixのテストが通るように修正
qwerty2501 01d6eca
API定義とそこまで関係ない実装はhelperに移動させた
qwerty2501 7f04348
VoicevoxInitializeOptionsをコメントを元に修正した
qwerty2501 d92c0e4
TtsOptionsの変換をFrom traitで行うようにした
qwerty2501 5892187
疑問文モードを実装した
qwerty2501 3f53f07
voicevox_default_synthesis_optionsを追加、enable_interrogative_upspeakがデフ…
qwerty2501 a489c4a
Merge branch 'main' of https://github.com/VOICEVOX/voicevox_core into…
qwerty2501 3e1136f
kanaは defaultとするようにした
qwerty2501 f697e09
use_gpu -> AccelerationModeに変更した
qwerty2501 07bc35b
GPU使用中かどうか判定するAPI関数を追加した
qwerty2501 d1e2c4b
defaultの記述を新しい形にした
qwerty2501 7e50250
Auto=0とした
qwerty2501 f6e4d9b
is_gpu_modeに名称変更
qwerty2501 a9c2cee
defaultオプション生成関数にmakeをつけた
qwerty2501 a599e17
output_binary_size->output_wav_sizeに変更 型をc_int->usizeに変更した
qwerty2501 d5af118
speaker_idをu32に変更した
qwerty2501 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
負数を入れる余地を作りたくなかったのでu32にしたがそれでよかったか? usizeだとちょっと大きすぎる気がしたので
内部的には c_intを使ってるので絶対に桁落ちさせないといういみではu16のほうがよかったかもしれない
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
どうなんでしょう? Python越しにせいぜい数回やりとりするデータなのでサイズはあまり問題ではないとは思うのですが、桁落ちも確かにありますね。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
内部的にはc_intなので usize -> c_intへの変更の際に桁落ちはありえますね。変換前にチェックして値が大きすぎたらエラーにする方法もまあなくはないですが、そもそもCPUの数でそこまで大きな値を指定することはないと考えるとusizeは冗長かもですね。
変換前に桁落ちしないかチェックが必要なのはu32も同じなので、そういう意味だとu16がベストかも?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
話はずれますがrepr(Rust)な方の構造体では
Option<NonZeroU32>
のように持つのもいいかもしれません。プリミティブな整数型に一対一で対応しますし。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ですね。
u16
がいいかも。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optionについてはどうでしょうね。 onnxruntimeではcpu_num_threads:0も意味のある値ではあるのでそのままu16としても良いかもしれませんが、onnxruntimeに依存しないという意味では
Option<NonZeroU16>
としてもいいかもしれないですが。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
あーそうでしたね。onnxruntimeにしか渡さないのならあまり意味はないかも。DLLを使うユーザーに提示できるならともかく。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cpu_num_threadsをu16に変更しました