-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Gracefully handle edge cases in harmony utils #23155
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
Conversation
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.
Code Review
This pull request introduces graceful handling for two edge cases in harmony_utils.py
. First, it prevents a KeyError
by using .get()
with a default value when parsing chat input content that may lack a 'text' attribute. Second, it avoids AttributeError
when a message recipient is None
by adding explicit None
checks before calling string methods. The changes are correct, well-contained, and effectively improve the robustness of the code as described. I have no further suggestions.
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
Signed-off-by: Jan Kessler <[email protected]>
7278a27
to
7f02c26
Compare
Signed-off-by: Jan Kessler <[email protected]>
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.
LGTM! Thanks for the fix.
Signed-off-by: Jan Kessler <[email protected]> Co-authored-by: Chen Zhang <[email protected]> Co-authored-by: Cyrus Leung <[email protected]>
Signed-off-by: Jan Kessler <[email protected]> Co-authored-by: Chen Zhang <[email protected]> Co-authored-by: Cyrus Leung <[email protected]>
Signed-off-by: Jan Kessler <[email protected]> Co-authored-by: Chen Zhang <[email protected]> Co-authored-by: Cyrus Leung <[email protected]>
Signed-off-by: Jan Kessler <[email protected]> Co-authored-by: Chen Zhang <[email protected]> Co-authored-by: Cyrus Leung <[email protected]>
Purpose
This PR adds better handling of the following situations in harmony_utils: