Skip to content

convert to numpy scalar automatically - #117

Merged
annereinarz merged 3 commits into
mainfrom
numpy-json-fix
Aug 4, 2026
Merged

convert to numpy scalar automatically#117
annereinarz merged 3 commits into
mainfrom
numpy-json-fix

Conversation

@annereinarz

Copy link
Copy Markdown
Member

Model outputs are usually numpy scalars/arrays. Since numpy 2.0 (NEP 51), repr() of a numpy scalar changed from just the number (e.g. "1.23") to "np.float64(1.23)", which breaks JSON serialization. Converting to native types first.

@annereinarz
annereinarz merged commit 6584aa9 into main Aug 4, 2026
32 checks passed
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.

1 participant