From 402d6feffa0572d1c7a957901b6d1702bd188484 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Thu, 4 Jul 2024 12:50:57 +0200 Subject: [PATCH] llama : suppress unref var in Windows MSVC (#8150) * llama : suppress unref var in Windows MSVC This commit suppresses two warnings that are currently generated for src/llama.cpp when building on Windows MSVC ```console C:\llama.cpp\src\llama.cpp(14349,45): warning C4101: 'ex': unreferenced local variable [C:\llama.cpp\build\src\llama.vcxproj] C:\llama.cpp\src\llama.cpp(19285,44): warning C4101: 'e': unreferenced local variable [C:\llama.cpp\build\src\llama.vcxproj] ``` * Update src/llama.cpp --------- Co-authored-by: Georgi Gerganov --- src/llama.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llama.cpp b/src/llama.cpp index 73f52435a..3d131b325 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -14781,7 +14781,7 @@ private: size_t prefix_offset = input_offset; unicode_cpt_from_utf8(input, prefix_offset); return { &input[input_offset], prefix_offset - input_offset, prefix_offset - input_offset }; - } catch(std::invalid_argument & ex) { + } catch (std::invalid_argument & /*ex*/) { // if no, consume 1 byte and return U+FFFD - REPLACEMENT CHARACTER return { "\xEF\xBF\xBD", 3, 1 }; } @@ -19725,7 +19725,7 @@ static std::string llama_decode_text(const std::string & text) { const auto utf8 = unicode_cpt_to_utf8(cpt); try { decoded_text += unicode_utf8_to_byte(utf8); - } catch (const std::out_of_range & e) { + } catch (const std::out_of_range & /*e*/) { decoded_text += "[UNK_BYTE_0x"; for (const auto c : utf8) { decoded_text += format("%02x", (uint8_t) c);