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
fix(Monitoring): Serializable log middleware #1908
fix(Monitoring): Serializable log middleware #1908
Conversation
16a12d2
to
a556026
Compare
src/argilla/monitoring/asgi.py
Outdated
@@ -67,16 +67,52 @@ def token_classification_mapper(inputs, outputs): | |||
|
|||
|
|||
def text_classification_mapper(inputs, outputs): |
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.
@frascuchon I updated the logic for the default mapper
src/argilla/monitoring/asgi.py
Outdated
] | ||
|
||
if records: | ||
records = self._records_mapper(inputs, outputs) |
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.
maybe it makes sense to create a try-except for the records mapper that provides some information about the input-output and that the _records_mapper is causing the error and can be adapted manually.
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.
+1
src/argilla/monitoring/asgi.py
Outdated
] | ||
|
||
if records: | ||
records = self._records_mapper(inputs, outputs) |
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.
+1
Also, review and format the class name
b924651
to
c533ef6
Compare
Done @davidberenstein1957 Now, the middleware is using a The code has changed a little bit. The main thing here is to provide the records properly in the Let me know if you have questions. |
for more information, see https://pre-commit.ci
…b.com/argilla-io/argilla into bugfixes/serializable-asgi-middleware
Cool @davidberenstein1957 !!! Great work. Only a comment. It would be nice if we add a minimal test for the question: Do we need to change the record_mapper for the rest of the tasks? |
I set the record_mapper to be a required variable to make the usage a bit more explicit and avoid potential questions. So, people always need to define a record mapper, especially since using it with ASGI is going to be usecase dependent. For the tests and as examples, I left the current record_mappers within the asgi file. I will add a |
Co-authored-by: Francisco Aranda <francis@argilla.io>
Also, review and format the class name