Skip to content
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

Some llama-run cleanups #11973

Merged
merged 1 commit into from
Feb 23, 2025
Merged

Some llama-run cleanups #11973

merged 1 commit into from
Feb 23, 2025

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 <ecurtin@redhat.com>
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.

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.

3 participants