fix warning C4146: unary minus operator applied to unsigned type, result still unsigned
This commit is contained in:
parent
bbde9e2269
commit
8dd390519b
1 changed files with 2 additions and 2 deletions
|
@ -13349,7 +13349,7 @@ int32_t llama_token_to_piece(const struct llama_model * model, llama_token token
|
||||||
} else if (llama_is_user_defined_token(model->vocab, token)) {
|
} else if (llama_is_user_defined_token(model->vocab, token)) {
|
||||||
std::string result = model->vocab.id_to_token[token].text;
|
std::string result = model->vocab.id_to_token[token].text;
|
||||||
if (length < (int) result.length()) {
|
if (length < (int) result.length()) {
|
||||||
return -result.length();
|
return -(int) result.length();
|
||||||
}
|
}
|
||||||
memcpy(buf, result.c_str(), result.length());
|
memcpy(buf, result.c_str(), result.length());
|
||||||
return result.length();
|
return result.length();
|
||||||
|
@ -13384,7 +13384,7 @@ int32_t llama_token_to_piece(const struct llama_model * model, llama_token token
|
||||||
} else if (llama_is_user_defined_token(model->vocab, token)) {
|
} else if (llama_is_user_defined_token(model->vocab, token)) {
|
||||||
std::string result = model->vocab.id_to_token[token].text;
|
std::string result = model->vocab.id_to_token[token].text;
|
||||||
if (length < (int) result.length()) {
|
if (length < (int) result.length()) {
|
||||||
return -result.length();
|
return -(int) result.length();
|
||||||
}
|
}
|
||||||
memcpy(buf, result.c_str(), result.length());
|
memcpy(buf, result.c_str(), result.length());
|
||||||
return result.length();
|
return result.length();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue