Skip to content

Commit 402d6fe

Browse files
danbevggerganov
andauthored
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 <[email protected]>
1 parent 20fc380 commit 402d6fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/llama.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14781,7 +14781,7 @@ struct llm_tokenizer_ugm {
1478114781
size_t prefix_offset = input_offset;
1478214782
unicode_cpt_from_utf8(input, prefix_offset);
1478314783
return { &input[input_offset], prefix_offset - input_offset, prefix_offset - input_offset };
14784-
} catch(std::invalid_argument & ex) {
14784+
} catch (std::invalid_argument & /*ex*/) {
1478514785
// if no, consume 1 byte and return U+FFFD - REPLACEMENT CHARACTER
1478614786
return { "\xEF\xBF\xBD", 3, 1 };
1478714787
}
@@ -19725,7 +19725,7 @@ static std::string llama_decode_text(const std::string & text) {
1972519725
const auto utf8 = unicode_cpt_to_utf8(cpt);
1972619726
try {
1972719727
decoded_text += unicode_utf8_to_byte(utf8);
19728-
} catch (const std::out_of_range & e) {
19728+
} catch (const std::out_of_range & /*e*/) {
1972919729
decoded_text += "[UNK_BYTE_0x";
1973019730
for (const auto c : utf8) {
1973119731
decoded_text += format("%02x", (uint8_t) c);

0 commit comments

Comments
 (0)