From fadcac4b5cfa3d0439e228320b08297bc6ca1263 Mon Sep 17 00:00:00 2001 From: Roy Shilkrot Date: Fri, 2 Aug 2024 22:20:54 -0400 Subject: [PATCH] refactor: Update target SPM loading error handling in translation module --- src/translation/translation.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/translation/translation.cpp b/src/translation/translation.cpp index c1ef7b7..e11f072 100644 --- a/src/translation/translation.cpp +++ b/src/translation/translation.cpp @@ -48,10 +48,11 @@ int build_translation_context(struct translation_context &translation_ctx) obs_log(LOG_INFO, "Loading target SPM from %s", target_spm_path.c_str()); translation_ctx.target_processor.reset( new sentencepiece::SentencePieceProcessor()); - const auto status = translation_ctx.target_processor->Load(target_spm_path); - if (!status.ok()) { + const auto target_status = + translation_ctx.target_processor->Load(target_spm_path); + if (!target_status.ok()) { obs_log(LOG_ERROR, "Failed to load target SPM: %s", - status.ToString().c_str()); + target_status.ToString().c_str()); return OBS_POLYGLOT_TRANSLATION_INIT_FAIL; } } else {