-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Handle invalid utf-8 bytes in engine class instead of model class #1094
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1094 +/- ##
===========================================
+ Coverage 49.79% 60.27% +10.47%
===========================================
Files 71 71
Lines 5880 5875 -5
===========================================
+ Hits 2928 3541 +613
+ Misses 2952 2334 -618 ☔ View full report in Codecov by Sentry. |
@hudson-ai can you help check this PR? |
@@ -543,13 +543,19 @@ def __call__( | |||
delayed_engine_outputs = [] | |||
elif not echo and engine_response.new_bytes: |
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.
Why is it that we only delay bytes if not echo
?
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.
there is another logic to process delayed_bytes if echo is True above.
Seems reasonable to me, but I'm not sure I have a strong opinion on whether this should be done in the engine vs in the model. Can you help me understand why you like this approach more? |
First, I think it does not make sense for the engine to generate bytes that the model could not even use, and have to do post-processing on the result. |
This PR removes unnecessary invalid utf-8 bytes handling code in Model class as we can better handle it in Engine class.