Skip to content

Commit f11fc31

Browse files
danbevggerganov
authored andcommitted
llama : suppress unref var in Windows MSVC (ggml-org#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 <[email protected]>
1 parent 2a0b01b commit f11fc31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llama.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15160,7 +15160,7 @@ struct llm_tokenizer_ugm {
1516015160
size_t prefix_offset = input_offset;
1516115161
unicode_cpt_from_utf8(input, prefix_offset);
1516215162
return { &input[input_offset], prefix_offset - input_offset, prefix_offset - input_offset };
15163-
} catch(std::invalid_argument & ex) {
15163+
} catch (std::invalid_argument & /*ex*/) {
1516415164
// if no, consume 1 byte and return U+FFFD - REPLACEMENT CHARACTER
1516515165
return { "\xEF\xBF\xBD", 3, 1 };
1516615166
}
@@ -22379,7 +22379,7 @@ static std::string llama_decode_text(const std::string & text) {
2237922379
const auto utf8 = unicode_cpt_to_utf8(cpt);
2238022380
try {
2238122381
decoded_text += unicode_utf8_to_byte(utf8);
22382-
} catch (const std::out_of_range & e) {
22382+
} catch (const std::out_of_range & /*e*/) {
2238322383
decoded_text += "[UNK_BYTE_0x";
2238422384
for (const auto c : utf8) {
2238522385
decoded_text += format("%02x", (uint8_t) c);

0 commit comments

Comments
 (0)