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

Serve json numpy encoding #2316

Merged
merged 5 commits into from
Jul 28, 2022

Conversation

jeffkinnison
Copy link
Contributor

This update handles a TypeError thrown by ludwig/serve.py when JSON-encoding numpy arrays with starlette.responses.JSONResponse objects. It includes:

  • A NumpyJSONResponse class that replaces the default JSON encoder with ludwig.utils.data_utils.NumpyEncoder
  • Updated NumpyJSONResponse instances in ludwig/serve.py
  • Unit tests for both NumpyEncoder and NumpyJSONResponse

@github-actions
Copy link

Unit Test Results

       5 files  ±0         5 suites  ±0   2h 4m 8s ⏱️ + 9m 13s
2 943 tests +2  2 894 ✔️ +2    49 💤 ±0  0 ±0 
8 704 runs  +6  8 542 ✔️ +6  162 💤 ±0  0 ±0 

Results for commit 9f65aa2. ± Comparison against base commit a2bce0e.

Copy link
Collaborator

@tgaddair tgaddair left a comment

Choose a reason for hiding this comment

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

Nice!

@tgaddair tgaddair merged commit 5069f19 into ludwig-ai:master Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants