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

JSON decode error when pulling wandb runs with invalid characters #131

Open
steffencruz opened this issue Aug 15, 2023 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@steffencruz
Copy link
Contributor

This appears to happen when the run summary metrics contains characters that are not JSON decodable. An example substring is

...ve decision making allows homogeneous feedbaÐJ57\"bckfor corrective drive and completional effort wi...

We should sanitize completions and prompts to ensure that there are no characters of this type and add unit tests

@steffencruz steffencruz added the bug Something isn't working label Aug 15, 2023
@steffencruz steffencruz self-assigned this Aug 15, 2023
@surcyf123
Copy link

surcyf123 commented Aug 17, 2023

This fixes it.

import json
# Store the original json.loads
original_json_loads = json.loads

def relaxed_json_loads(s, *args, **kwargs):
    kwargs.pop("strict", None)  # remove the strict argument if it exists
    return original_json_loads(s, strict=False, *args, **kwargs)

# Patch the library's json.loads
json.loads = relaxed_json_loads

This way we can keep the original data and it won't throw the error and we can still pull all runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants