-
Notifications
You must be signed in to change notification settings - Fork 14.5k
llama: fix integer type consistency in split helpers #18798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
llama: fix integer type consistency in split helpers #18798
Conversation
c985cbb to
671707e
Compare
|
Thanks for pointing this out! |
taronaeo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks fine. I'll defer my review to @ggerganov as this affects libllama.
|
I had some minor style fixes somewhere, but I think the branch was write-protected and wasn't able to push. diffdiff --git a/src/llama.cpp b/src/llama.cpp
index b3275ecae..eca063ecc 100644
--- a/src/llama.cpp
+++ b/src/llama.cpp
@@ -1116,7 +1116,6 @@ int32_t llama_split_path(
return (int32_t) written;
}
-
int32_t llama_split_prefix(
char * split_prefix,
size_t maxlen,
@@ -1128,8 +1127,8 @@ int32_t llama_split_prefix(
char postfix[32];
snprintf(postfix, sizeof(postfix), "-%05d-of-%05d.gguf", split_no + 1, split_count);
- const std::string str_postfix(postfix);
+ const std::string str_postfix(postfix);
if (str_split_path.size() <= str_postfix.size()) {
return 0;
}
@@ -1139,13 +1138,13 @@ int32_t llama_split_prefix(
if (str_split_path.compare(size_prefix, std::string::npos, str_postfix) == 0) {
const size_t copy_len = std::min(size_prefix + 1, maxlen);
snprintf(split_prefix, copy_len, "%s", split_path);
+
return (int32_t) size_prefix;
}
return 0;
}
-
const char * llama_print_system_info(void) {
static std::string s;
s.clear(); // Clear the string, since it's static, otherwise it will accumulate data from previous calls. |
|
Thanks! |
|
Thanks for the review! I’ve fixed the EditorConfig issues (trailing whitespace) and pushed the update. The remaining CI failures appear to be limited to server builds This PR does not touch server or CMake logic, so these failures seem Please let me know if you’d like me to adjust anything on my side, |
Please try to rebase with master. |
|
I rebased the change cleanly on latest master and pushed a fresh branch |

This PR fixes integer type inconsistencies in
llama_split_pathand
llama_split_prefix.Changes:
intwithint32_tsize_tMotivation:
llama.h#4574No behavior or API changes intended.