8000 [BUGFIX] Guard against UnicodeEncodeError when saving validation results in Google Colab environment by alexsherstinsky · Pull Request #3875 · ludwig-ai/ludwig · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[BUGFIX] Guard against UnicodeEncodeError when saving validation results in Google Colab environment #3875

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

Conversation

alexsherstinsky
Copy link
Collaborator
@alexsherstinsky alexsherstinsky commented Jan 10, 2024

Scope

If the textual data in the validation dataset contains non-ASCII characters, saving the results to storage may encounter errors, such as:

UnicodeEncodeError: 'ascii' codec can't encode character '\u2260' in position 2699: ordinal not in range(128)

The fix consists of defensively converting the contents to the UTF-8 format.

Remark

This error was not observed in isolated GPU environments such as while using EC2 outside of Colab, but this change assures stable behavior in all environments.

Copy link

Unit Test Results

  6 files    6 suites   14m 17s ⏱️
12 tests   9 ✔️   3 💤 0
60 runs  42 ✔️ 18 💤 0

Results for commit 150265e.

@alexsherstinsky alexsherstinsky merged commit c3bc33e into master Jan 10, 2024
@alexsherstinsky alexsherstinsky deleted the bugfix/alexsherstinsky/MLX-1678/train/evaluate/unicode_encode_error_ascii_code-2024_01_07-24 branch January 10, 2024 20:53
@justinxzhao
Copy link
Contributor

It's probably worth specifying the encoding everywhere we are writing files to disk!

vijayi1 pushed a commit to vijayi1/ludwig that referenced this pull request Jan 23, 2024
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.

3 participants
0