Skip to content

Conversation

@ericcurtin
Copy link
Collaborator

@ericcurtin ericcurtin commented Feb 20, 2025

Use consolidated open function call from File class. Change read_all to to_string(). Remove exclusive locking, the intent for that lock is to avoid multiple processes writing to the same file, it's not an issue for readers, although we may want to consider adding a shared lock. Remove passing nullptr as reference, references are never supposed to be null. clang-format the code for consistent styling.

@ericcurtin ericcurtin force-pushed the llama-run-cleanups branch 2 times, most recently from 065c597 to 62c23df Compare February 20, 2025 13:56
@ericcurtin
Copy link
Collaborator Author

@engelmi PTAL

Use consolidated open function call from File class. Change
read_all to to_string(). Remove exclusive locking, the intent for
that lock is to avoid multiple processes writing to the same file,
it's not an issue for readers, although we may want to consider
adding a shared lock. Remove passing nullptr as reference,
references are never supposed to be null. clang-format the code
for consistent styling.

Signed-off-by: Eric Curtin <[email protected]>
Copy link
Contributor

@engelmi engelmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ericcurtin
Copy link
Collaborator Author

@ngxson I need an approval here, this is mostly refactoring with some functional changes

Copy link
Collaborator

@ngxson ngxson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% familiar the new common_chat_templates, so for changes related to this you should check with both me and @ochafik

Btw it would be better to have test scripts, not necessary run on CI, but at least runnable locally.

@ericcurtin
Copy link
Collaborator Author

ericcurtin commented Feb 22, 2025

@ochafik kindly made the initial change to common_chat_templates_init in llama-run. This change ensures we don't pass nullptr to the function.

@ericcurtin ericcurtin merged commit f777a73 into master Feb 23, 2025
46 checks passed
@ericcurtin ericcurtin deleted the llama-run-cleanups branch February 23, 2025 13:15
@ericcurtin
Copy link
Collaborator Author

I merged this anyway to get rid of the seg fault people were reporting.

orca-zhang pushed a commit to orca-zhang/llama.cpp that referenced this pull request Feb 26, 2025
Use consolidated open function call from File class. Change
read_all to to_string(). Remove exclusive locking, the intent for
that lock is to avoid multiple processes writing to the same file,
it's not an issue for readers, although we may want to consider
adding a shared lock. Remove passing nullptr as reference,
references are never supposed to be null. clang-format the code
for consistent styling.

Signed-off-by: Eric Curtin <[email protected]>
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Feb 26, 2025
Use consolidated open function call from File class. Change
read_all to to_string(). Remove exclusive locking, the intent for
that lock is to avoid multiple processes writing to the same file,
it's not an issue for readers, although we may want to consider
adding a shared lock. Remove passing nullptr as reference,
references are never supposed to be null. clang-format the code
for consistent styling.

Signed-off-by: Eric Curtin <[email protected]>
mglambda pushed a commit to mglambda/llama.cpp that referenced this pull request Mar 8, 2025
Use consolidated open function call from File class. Change
read_all to to_string(). Remove exclusive locking, the intent for
that lock is to avoid multiple processes writing to the same file,
it's not an issue for readers, although we may want to consider
adding a shared lock. Remove passing nullptr as reference,
references are never supposed to be null. clang-format the code
for consistent styling.

Signed-off-by: Eric Curtin <[email protected]>
mostlyuseful pushed a commit to mostlyuseful/llama.cpp that referenced this pull request May 12, 2025
Use consolidated open function call from File class. Change
read_all to to_string(). Remove exclusive locking, the intent for
that lock is to avoid multiple processes writing to the same file,
it's not an issue for readers, although we may want to consider
adding a shared lock. Remove passing nullptr as reference,
references are never supposed to be null. clang-format the code
for consistent styling.

Signed-off-by: Eric Curtin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants