From 317b433e985c5612510dec53c347a098f35361f0 Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Tue, 20 Aug 2024 02:29:07 +0900 Subject: [PATCH] =?UTF-8?q?change:=20`InferenceFailed`=20=E2=86=92=20`RunM?= =?UTF-8?q?odel`=20(#823)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/voicevox_core/src/error.rs | 6 +- crates/voicevox_core/src/infer/session_set.rs | 2 +- .../include/voicevox_core.h | 2 +- crates/voicevox_core_c_api/src/helpers.rs | 2 +- crates/voicevox_core_c_api/src/result_code.rs | 4 +- .../tests/e2e/testcases/global_info.rs | 2 +- .../hiroshiba/voicevoxcore/Synthesizer.java | 67 +++++++++---------- .../exceptions/InferenceFailedException.java | 14 ---- .../exceptions/RunModelException.java | 14 ++++ .../voicevoxcore/SynthesizerTest.java | 8 +-- .../hiroshiba/voicevoxcore/UserDictTest.java | 5 +- crates/voicevox_core_java_api/src/common.rs | 2 +- .../python/voicevox_core/__init__.py | 4 +- .../python/voicevox_core/_rust/__init__.pyi | 2 +- .../voicevox_core_python_api/src/convert.rs | 6 +- crates/voicevox_core_python_api/src/lib.rs | 2 +- 16 files changed, 68 insertions(+), 74 deletions(-) delete mode 100644 crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/exceptions/InferenceFailedException.java create mode 100644 crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/exceptions/RunModelException.java diff --git a/crates/voicevox_core/src/error.rs b/crates/voicevox_core/src/error.rs index 0125b1cc6..33775bda0 100644 --- a/crates/voicevox_core/src/error.rs +++ b/crates/voicevox_core/src/error.rs @@ -47,7 +47,7 @@ impl Error { ErrorRepr::GetSupportedDevices(_) => ErrorKind::GetSupportedDevices, ErrorRepr::StyleNotFound { .. } => ErrorKind::StyleNotFound, ErrorRepr::ModelNotFound { .. } => ErrorKind::ModelNotFound, - ErrorRepr::InferenceFailed { .. } => ErrorKind::InferenceFailed, + ErrorRepr::RunModel { .. } => ErrorKind::RunModel, ErrorRepr::ExtractFullContextLabel(_) => ErrorKind::ExtractFullContextLabel, ErrorRepr::ParseKana(_) => ErrorKind::ParseKana, ErrorRepr::LoadUserDict(_) => ErrorKind::LoadUserDict, @@ -97,7 +97,7 @@ pub(crate) enum ErrorRepr { ModelNotFound { model_id: VoiceModelId }, #[error("推論に失敗しました")] - InferenceFailed(#[source] anyhow::Error), + RunModel(#[source] anyhow::Error), #[error(transparent)] ExtractFullContextLabel(#[from] FullContextLabelError), @@ -149,7 +149,7 @@ pub enum ErrorKind { /// 音声モデルIDに対する音声モデルが見つからなかった。 ModelNotFound, /// 推論に失敗した。 - InferenceFailed, + RunModel, /// コンテキストラベル出力に失敗した。 ExtractFullContextLabel, /// AquesTalk風記法のテキストの解析に失敗した。 diff --git a/crates/voicevox_core/src/infer/session_set.rs b/crates/voicevox_core/src/infer/session_set.rs index ad85e93ac..e94fff962 100644 --- a/crates/voicevox_core/src/infer/session_set.rs +++ b/crates/voicevox_core/src/infer/session_set.rs @@ -95,7 +95,7 @@ impl InferenceSessionCell ) -> crate::Result<::Output> { let inner = &mut self.inner.lock().unwrap(); (|| R::run(input.make_run_context::(inner)?)?.try_into())() - .map_err(ErrorRepr::InferenceFailed) + .map_err(ErrorRepr::RunModel) .map_err(Into::into) } } diff --git a/crates/voicevox_core_c_api/include/voicevox_core.h b/crates/voicevox_core_c_api/include/voicevox_core.h index fe514dfa9..422f32978 100644 --- a/crates/voicevox_core_c_api/include/voicevox_core.h +++ b/crates/voicevox_core_c_api/include/voicevox_core.h @@ -141,7 +141,7 @@ enum VoicevoxResultCode /** * 推論に失敗した */ - VOICEVOX_RESULT_INFERENCE_ERROR = 8, + VOICEVOX_RESULT_RUN_MODEL_ERROR = 8, /** * コンテキストラベル出力に失敗した */ diff --git a/crates/voicevox_core_c_api/src/helpers.rs b/crates/voicevox_core_c_api/src/helpers.rs index af4057d09..26a60d033 100644 --- a/crates/voicevox_core_c_api/src/helpers.rs +++ b/crates/voicevox_core_c_api/src/helpers.rs @@ -39,7 +39,7 @@ pub(crate) fn into_result_code_with_error(result: CApiResult<()>) -> VoicevoxRes GetSupportedDevices => VOICEVOX_RESULT_GET_SUPPORTED_DEVICES_ERROR, StyleNotFound => VOICEVOX_RESULT_STYLE_NOT_FOUND_ERROR, ModelNotFound => VOICEVOX_RESULT_MODEL_NOT_FOUND_ERROR, - InferenceFailed => VOICEVOX_RESULT_INFERENCE_ERROR, + RunModel => VOICEVOX_RESULT_RUN_MODEL_ERROR, ExtractFullContextLabel => VOICEVOX_RESULT_EXTRACT_FULL_CONTEXT_LABEL_ERROR, ParseKana => VOICEVOX_RESULT_PARSE_KANA_ERROR, LoadUserDict => VOICEVOX_RESULT_LOAD_USER_DICT_ERROR, diff --git a/crates/voicevox_core_c_api/src/result_code.rs b/crates/voicevox_core_c_api/src/result_code.rs index 085f2b8c6..bfdbc8444 100644 --- a/crates/voicevox_core_c_api/src/result_code.rs +++ b/crates/voicevox_core_c_api/src/result_code.rs @@ -24,7 +24,7 @@ pub enum VoicevoxResultCode { /// 音声モデルIDに対する音声モデルが見つからなかった VOICEVOX_RESULT_MODEL_NOT_FOUND_ERROR = 7, /// 推論に失敗した - VOICEVOX_RESULT_INFERENCE_ERROR = 8, + VOICEVOX_RESULT_RUN_MODEL_ERROR = 8, /// コンテキストラベル出力に失敗した VOICEVOX_RESULT_EXTRACT_FULL_CONTEXT_LABEL_ERROR = 11, /// 無効なutf8文字列が入力された @@ -83,7 +83,7 @@ pub(crate) const fn error_result_to_message(result_code: VoicevoxResultCode) -> "指定されたIDに対する音声モデルが見つかりませんでした。読み込まれていないか、読み込み\ が既に解除されています" ), - VOICEVOX_RESULT_INFERENCE_ERROR => cstr!("推論に失敗しました"), + VOICEVOX_RESULT_RUN_MODEL_ERROR => cstr!("推論に失敗しました"), VOICEVOX_RESULT_EXTRACT_FULL_CONTEXT_LABEL_ERROR => { cstr!("入力テキストからのフルコンテキストラベル抽出に失敗しました") } diff --git a/crates/voicevox_core_c_api/tests/e2e/testcases/global_info.rs b/crates/voicevox_core_c_api/tests/e2e/testcases/global_info.rs index e3303db4f..a36a7d9bd 100644 --- a/crates/voicevox_core_c_api/tests/e2e/testcases/global_info.rs +++ b/crates/voicevox_core_c_api/tests/e2e/testcases/global_info.rs @@ -54,7 +54,7 @@ impl assert_cdylib::TestCase for TestCase { c_api::VoicevoxResultCode_VOICEVOX_RESULT_GPU_SUPPORT_ERROR, c_api::VoicevoxResultCode_VOICEVOX_RESULT_STYLE_NOT_FOUND_ERROR, c_api::VoicevoxResultCode_VOICEVOX_RESULT_MODEL_NOT_FOUND_ERROR, - c_api::VoicevoxResultCode_VOICEVOX_RESULT_INFERENCE_ERROR, + c_api::VoicevoxResultCode_VOICEVOX_RESULT_RUN_MODEL_ERROR, c_api::VoicevoxResultCode_VOICEVOX_RESULT_EXTRACT_FULL_CONTEXT_LABEL_ERROR, c_api::VoicevoxResultCode_VOICEVOX_RESULT_INVALID_UTF8_INPUT_ERROR, c_api::VoicevoxResultCode_VOICEVOX_RESULT_PARSE_KANA_ERROR, diff --git a/crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/Synthesizer.java b/crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/Synthesizer.java index 8d5694267..2fac70741 100644 --- a/crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/Synthesizer.java +++ b/crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/Synthesizer.java @@ -7,8 +7,8 @@ import java.util.List; import java.util.Optional; import java.util.UUID; -import jp.hiroshiba.voicevoxcore.exceptions.InferenceFailedException; import jp.hiroshiba.voicevoxcore.exceptions.InvalidModelDataException; +import jp.hiroshiba.voicevoxcore.exceptions.RunModelException; /** * 音声シンセサイザ。 @@ -99,11 +99,10 @@ public boolean isLoadedVoiceModel(UUID voiceModelId) { * @param kana AquesTalk風記法。 * @param styleId スタイルID。 * @return {@link AudioQuery}。 - * @throws InferenceFailedException 推論に失敗した場合。 + * @throws RunModelException 推論に失敗した場合。 */ @Nonnull - public AudioQuery createAudioQueryFromKana(String kana, int styleId) - throws InferenceFailedException { + public AudioQuery createAudioQueryFromKana(String kana, int styleId) throws RunModelException { if (!Utils.isU32(styleId)) { throw new IllegalArgumentException("styleId"); } @@ -123,10 +122,10 @@ public AudioQuery createAudioQueryFromKana(String kana, int styleId) * @param text 日本語のテキスト。 * @param styleId スタイルID。 * @return {@link AudioQuery}。 - * @throws InferenceFailedException 推論に失敗した場合。 + * @throws RunModelException 推論に失敗した場合。 */ @Nonnull - public AudioQuery createAudioQuery(String text, int styleId) throws InferenceFailedException { + public AudioQuery createAudioQuery(String text, int styleId) throws RunModelException { if (!Utils.isU32(styleId)) { throw new IllegalArgumentException("styleId"); } @@ -146,11 +145,11 @@ public AudioQuery createAudioQuery(String text, int styleId) throws InferenceFai * @param kana AquesTalk風記法。 * @param styleId スタイルID。 * @return {@link AccentPhrase} のリスト。 - * @throws InferenceFailedException 推論に失敗した場合。 + * @throws RunModelException 推論に失敗した場合。 */ @Nonnull public List createAccentPhrasesFromKana(String kana, int styleId) - throws InferenceFailedException { + throws RunModelException { String accentPhrasesJson = rsAccentPhrasesFromKana(kana, styleId); Gson gson = new Gson(); AccentPhrase[] rawAccentPhrases = gson.fromJson(accentPhrasesJson, AccentPhrase[].class); @@ -166,11 +165,10 @@ public List createAccentPhrasesFromKana(String kana, int styleId) * @param text 日本語のテキスト。 * @param styleId スタイルID。 * @return {@link AccentPhrase} のリスト。 - * @throws InferenceFailedException 推論に失敗した場合。 + * @throws RunModelException 推論に失敗した場合。 */ @Nonnull - public List createAccentPhrases(String text, int styleId) - throws InferenceFailedException { + public List createAccentPhrases(String text, int styleId) throws RunModelException { String accentPhrasesJson = rsAccentPhrases(text, styleId); Gson gson = new Gson(); AccentPhrase[] rawAccentPhrases = gson.fromJson(accentPhrasesJson, AccentPhrase[].class); @@ -186,11 +184,11 @@ public List createAccentPhrases(String text, int styleId) * @param accentPhrases 変更元のアクセント句の配列。 * @param styleId スタイルID。 * @return 変更後のアクセント句の配列。 - * @throws InferenceFailedException 推論に失敗した場合。 + * @throws RunModelException 推論に失敗した場合。 */ @Nonnull public List replaceMoraData(List accentPhrases, int styleId) - throws InferenceFailedException { + throws RunModelException { if (!Utils.isU32(styleId)) { throw new IllegalArgumentException("styleId"); } @@ -206,11 +204,11 @@ public List replaceMoraData(List accentPhrases, int * @param accentPhrases 変更元のアクセント句の配列。 * @param styleId スタイルID。 * @return 変更後のアクセント句の配列。 - * @throws InferenceFailedException 推論に失敗した場合。 + * @throws RunModelException 推論に失敗した場合。 */ @Nonnull public List replacePhonemeLength(List accentPhrases, int styleId) - throws InferenceFailedException { + throws RunModelException { if (!Utils.isU32(styleId)) { throw new IllegalArgumentException("styleId"); } @@ -226,11 +224,11 @@ public List replacePhonemeLength(List accentPhrases, * @param accentPhrases 変更元のアクセント句の配列。 * @param styleId スタイルID。 * @return 変更後のアクセント句の配列。 - * @throws InferenceFailedException 推論に失敗した場合。 + * @throws RunModelException 推論に失敗した場合。 */ @Nonnull public List replaceMoraPitch(List accentPhrases, int styleId) - throws InferenceFailedException { + throws RunModelException { if (!Utils.isU32(styleId)) { throw new IllegalArgumentException("styleId"); } @@ -293,43 +291,40 @@ public TtsConfigurator tts(String text, int styleId) { private native boolean rsIsLoadedVoiceModel(UUID voiceModelId); @Nonnull - private native String rsAudioQueryFromKana(String kana, int styleId) - throws InferenceFailedException; + private native String rsAudioQueryFromKana(String kana, int styleId) throws RunModelException; @Nonnull - private native String rsAudioQuery(String text, int styleId) throws InferenceFailedException; + private native String rsAudioQuery(String text, int styleId) throws RunModelException; @Nonnull - private native String rsAccentPhrasesFromKana(String kana, int styleId) - throws InferenceFailedException; + private native String rsAccentPhrasesFromKana(String kana, int styleId) throws RunModelException; @Nonnull - private native String rsAccentPhrases(String text, int styleId) throws InferenceFailedException; + private native String rsAccentPhrases(String text, int styleId) throws RunModelException; @Nonnull private native String rsReplaceMoraData(String accentPhrasesJson, int styleId, boolean kana) - throws InferenceFailedException; + throws RunModelException; @Nonnull private native String rsReplacePhonemeLength(String accentPhrasesJson, int styleId, boolean kana) - throws InferenceFailedException; + throws RunModelException; @Nonnull private native String rsReplaceMoraPitch(String accentPhrasesJson, int styleId, boolean kana) - throws InferenceFailedException; + throws RunModelException; @Nonnull private native byte[] rsSynthesis( - String queryJson, int styleId, boolean enableInterrogativeUpspeak) - throws InferenceFailedException; + String queryJson, int styleId, boolean enableInterrogativeUpspeak) throws RunModelException; @Nonnull private native byte[] rsTtsFromKana(String kana, int styleId, boolean enableInterrogativeUpspeak) - throws InferenceFailedException; + throws RunModelException; @Nonnull private native byte[] rsTts(String text, int styleId, boolean enableInterrogativeUpspeak) - throws InferenceFailedException; + throws RunModelException; private native void rsDrop(); @@ -436,10 +431,10 @@ public SynthesisConfigurator interrogativeUpspeak(boolean interrogativeUpspeak) * {@link AudioQuery} から音声合成する。 * * @return 音声データ。 - * @throws InferenceFailedException 推論に失敗した場合。 + * @throws RunModelException 推論に失敗した場合。 */ @Nonnull - public byte[] execute() throws InferenceFailedException { + public byte[] execute() throws RunModelException { if (!Utils.isU32(styleId)) { throw new IllegalArgumentException("styleId"); } @@ -481,10 +476,10 @@ public TtsFromKanaConfigurator interrogativeUpspeak(boolean interrogativeUpspeak * {@link AudioQuery} から音声合成する。 * * @return 音声データ。 - * @throws InferenceFailedException 推論に失敗した場合。 + * @throws RunModelException 推論に失敗した場合。 */ @Nonnull - public byte[] execute() throws InferenceFailedException { + public byte[] execute() throws RunModelException { if (!Utils.isU32(styleId)) { throw new IllegalArgumentException("styleId"); } @@ -524,10 +519,10 @@ public TtsConfigurator interrogativeUpspeak(boolean interrogativeUpspeak) { * {@link AudioQuery} から音声合成する。 * * @return 音声データ。 - * @throws InferenceFailedException 推論に失敗した場合。 + * @throws RunModelException 推論に失敗した場合。 */ @Nonnull - public byte[] execute() throws InferenceFailedException { + public byte[] execute() throws RunModelException { if (!Utils.isU32(styleId)) { throw new IllegalArgumentException("styleId"); } diff --git a/crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/exceptions/InferenceFailedException.java b/crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/exceptions/InferenceFailedException.java deleted file mode 100644 index 499a530df..000000000 --- a/crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/exceptions/InferenceFailedException.java +++ /dev/null @@ -1,14 +0,0 @@ -package jp.hiroshiba.voicevoxcore.exceptions; - -import java.io.IOException; - -/** 推論に失敗した。 */ -public class InferenceFailedException extends IOException { - public InferenceFailedException(String message) { - super(message); - } - - public InferenceFailedException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/exceptions/RunModelException.java b/crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/exceptions/RunModelException.java new file mode 100644 index 000000000..67d7f061f --- /dev/null +++ b/crates/voicevox_core_java_api/lib/src/main/java/jp/hiroshiba/voicevoxcore/exceptions/RunModelException.java @@ -0,0 +1,14 @@ +package jp.hiroshiba.voicevoxcore.exceptions; + +import java.io.IOException; + +/** 推論に失敗した。 */ +public class RunModelException extends IOException { + public RunModelException(String message) { + super(message); + } + + public RunModelException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/crates/voicevox_core_java_api/lib/src/test/java/jp/hiroshiba/voicevoxcore/SynthesizerTest.java b/crates/voicevox_core_java_api/lib/src/test/java/jp/hiroshiba/voicevoxcore/SynthesizerTest.java index 4de2f617b..0dfa17ea3 100644 --- a/crates/voicevox_core_java_api/lib/src/test/java/jp/hiroshiba/voicevoxcore/SynthesizerTest.java +++ b/crates/voicevox_core_java_api/lib/src/test/java/jp/hiroshiba/voicevoxcore/SynthesizerTest.java @@ -8,8 +8,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.List; -import jp.hiroshiba.voicevoxcore.exceptions.InferenceFailedException; import jp.hiroshiba.voicevoxcore.exceptions.InvalidModelDataException; +import jp.hiroshiba.voicevoxcore.exceptions.RunModelException; import org.junit.jupiter.api.Test; class SynthesizerTest extends TestUtils { @@ -67,7 +67,7 @@ void checkModel() throws InvalidModelDataException { } @Test - void checkAudioQuery() throws InferenceFailedException, InvalidModelDataException { + void checkAudioQuery() throws RunModelException, InvalidModelDataException { VoiceModel model = loadModel(); Onnxruntime onnxruntime = loadOnnxruntime(); OpenJtalk openJtalk = loadOpenJtalk(); @@ -79,7 +79,7 @@ void checkAudioQuery() throws InferenceFailedException, InvalidModelDataExceptio } @Test - void checkAccentPhrases() throws InferenceFailedException, InvalidModelDataException { + void checkAccentPhrases() throws RunModelException, InvalidModelDataException { VoiceModel model = loadModel(); OpenJtalk openJtalk = loadOpenJtalk(); Onnxruntime onnxruntime = loadOnnxruntime(); @@ -110,7 +110,7 @@ void checkAccentPhrases() throws InferenceFailedException, InvalidModelDataExcep } @Test - void checkTts() throws InferenceFailedException, InvalidModelDataException { + void checkTts() throws RunModelException, InvalidModelDataException { VoiceModel model = loadModel(); Onnxruntime onnxruntime = loadOnnxruntime(); OpenJtalk openJtalk = loadOpenJtalk(); diff --git a/crates/voicevox_core_java_api/lib/src/test/java/jp/hiroshiba/voicevoxcore/UserDictTest.java b/crates/voicevox_core_java_api/lib/src/test/java/jp/hiroshiba/voicevoxcore/UserDictTest.java index 5300b81f3..2fcfc06ab 100644 --- a/crates/voicevox_core_java_api/lib/src/test/java/jp/hiroshiba/voicevoxcore/UserDictTest.java +++ b/crates/voicevox_core_java_api/lib/src/test/java/jp/hiroshiba/voicevoxcore/UserDictTest.java @@ -4,9 +4,9 @@ import java.nio.file.Files; import java.nio.file.Path; -import jp.hiroshiba.voicevoxcore.exceptions.InferenceFailedException; import jp.hiroshiba.voicevoxcore.exceptions.InvalidModelDataException; import jp.hiroshiba.voicevoxcore.exceptions.LoadUserDictException; +import jp.hiroshiba.voicevoxcore.exceptions.RunModelException; import org.junit.jupiter.api.Test; class UserDictTest extends TestUtils { @@ -14,8 +14,7 @@ class UserDictTest extends TestUtils { // 辞書ロードのテスト。 // 辞書ロード前後でkanaが異なることを確認する @Test - void checkLoad() - throws InferenceFailedException, InvalidModelDataException, LoadUserDictException { + void checkLoad() throws RunModelException, InvalidModelDataException, LoadUserDictException { VoiceModel model = loadModel(); Onnxruntime onnxruntime = loadOnnxruntime(); OpenJtalk openJtalk = loadOpenJtalk(); diff --git a/crates/voicevox_core_java_api/src/common.rs b/crates/voicevox_core_java_api/src/common.rs index c55ce8106..1b45dd44d 100644 --- a/crates/voicevox_core_java_api/src/common.rs +++ b/crates/voicevox_core_java_api/src/common.rs @@ -82,7 +82,7 @@ where GetSupportedDevices, StyleNotFound, ModelNotFound, - InferenceFailed, + RunModel, ExtractFullContextLabel, ParseKana, LoadUserDict, diff --git a/crates/voicevox_core_python_api/python/voicevox_core/__init__.py b/crates/voicevox_core_python_api/python/voicevox_core/__init__.py index e9a0a03c0..ea1f246b9 100644 --- a/crates/voicevox_core_python_api/python/voicevox_core/__init__.py +++ b/crates/voicevox_core_python_api/python/voicevox_core/__init__.py @@ -18,7 +18,6 @@ ExtractFullContextLabelError, GetSupportedDevicesError, GpuSupportError, - InferenceFailedError, InitInferenceRuntimeError, InvalidModelDataError, InvalidWordError, @@ -29,6 +28,7 @@ OpenZipFileError, ParseKanaError, ReadZipEntryError, + RunModelError, SaveUserDictError, StyleAlreadyLoadedError, StyleNotFoundError, @@ -49,7 +49,6 @@ "ExtractFullContextLabelError", "GetSupportedDevicesError", "GpuSupportError", - "InferenceFailedError", "InitInferenceRuntimeError", "InvalidModelDataError", "InvalidWordError", @@ -61,6 +60,7 @@ "OpenZipFileError", "ParseKanaError", "ReadZipEntryError", + "RunModelError", "SaveUserDictError", "SpeakerMeta", "StyleAlreadyLoadedError", diff --git a/crates/voicevox_core_python_api/python/voicevox_core/_rust/__init__.pyi b/crates/voicevox_core_python_api/python/voicevox_core/_rust/__init__.pyi index 81168843f..a456b1162 100644 --- a/crates/voicevox_core_python_api/python/voicevox_core/_rust/__init__.pyi +++ b/crates/voicevox_core_python_api/python/voicevox_core/_rust/__init__.pyi @@ -60,7 +60,7 @@ class ModelNotFoundError(KeyError): ... -class InferenceFailedError(Exception): +class RunModelError(Exception): """推論に失敗した。""" ... diff --git a/crates/voicevox_core_python_api/src/convert.rs b/crates/voicevox_core_python_api/src/convert.rs index b625f70b5..e57f2fb13 100644 --- a/crates/voicevox_core_python_api/src/convert.rs +++ b/crates/voicevox_core_python_api/src/convert.rs @@ -13,10 +13,10 @@ use uuid::Uuid; use voicevox_core::{AccelerationMode, AccentPhrase, StyleId, UserDictWordType, VoiceModelMeta}; use crate::{ - ExtractFullContextLabelError, GetSupportedDevicesError, GpuSupportError, InferenceFailedError, + ExtractFullContextLabelError, GetSupportedDevicesError, GpuSupportError, InitInferenceRuntimeError, InvalidModelDataError, InvalidModelFormatError, InvalidWordError, LoadUserDictError, ModelAlreadyLoadedError, ModelNotFoundError, NotLoadedOpenjtalkDictError, - OpenZipFileError, ParseKanaError, ReadZipEntryError, SaveUserDictError, + OpenZipFileError, ParseKanaError, ReadZipEntryError, RunModelError, SaveUserDictError, StyleAlreadyLoadedError, StyleNotFoundError, UseUserDictError, WordNotFoundError, }; @@ -196,7 +196,7 @@ pub(crate) impl voicevox_core::Result { ErrorKind::GetSupportedDevices => GetSupportedDevicesError::new_err(msg), ErrorKind::StyleNotFound => StyleNotFoundError::new_err(msg), ErrorKind::ModelNotFound => ModelNotFoundError::new_err(msg), - ErrorKind::InferenceFailed => InferenceFailedError::new_err(msg), + ErrorKind::RunModel => RunModelError::new_err(msg), ErrorKind::ExtractFullContextLabel => ExtractFullContextLabelError::new_err(msg), ErrorKind::ParseKana => ParseKanaError::new_err(msg), ErrorKind::LoadUserDict => LoadUserDictError::new_err(msg), diff --git a/crates/voicevox_core_python_api/src/lib.rs b/crates/voicevox_core_python_api/src/lib.rs index 001df0713..d3d790075 100644 --- a/crates/voicevox_core_python_api/src/lib.rs +++ b/crates/voicevox_core_python_api/src/lib.rs @@ -78,7 +78,7 @@ exceptions! { GetSupportedDevicesError: PyException; StyleNotFoundError: PyKeyError; ModelNotFoundError: PyKeyError; - InferenceFailedError: PyException; + RunModelError: PyException; ExtractFullContextLabelError: PyException; ParseKanaError: PyValueError; LoadUserDictError: PyException;