Skip to content

Conversation

Kovbo
Copy link
Collaborator

@Kovbo Kovbo commented Aug 12, 2025

Python throws this error when you run a training script using uv run file.py.

UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 31733: ordinal not in range(128)
But if you run it from a notebook, it works fine.

The problem is that Python’s default text encoding is determined by OS locale, and in many cases, it assumes ASCII.
Jupyter kernel, on the other hand, runs in UTF-8.

ASCII encoding doesn’t seem to work with unsloth-zoo. There is an open PR, but it has not been merged yet.

We can temporarily enforce UTF-8 encoding until unsloth fixes the issue.

@bradhilton bradhilton merged commit c3f5e00 into main Aug 12, 2025
2 checks passed
@bradhilton bradhilton deleted the fix-ascii-issue branch August 12, 2025 03:18
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.

2 participants