Skip to content

Conversation

@tomaarsen
Copy link
Member

Hello!

Pull Request overview

  • Add utf8 encoding to read_text to avoid Windows charmap crash

Details

If I call push_to_hub with a README that uses any non-"standard" character, as is common in my automatically generated model cards in Sentence Transformers, then it'll crash on Windows due to this error: https://stackoverflow.com/questions/14630288/unicodeencodeerror-charmap-codec-cant-encode-character-maps-to-undefined

This is always easily fixed by ensuring that the README is read in utf8.

cc @Wauplin @hlky

  • Tom Aarsen

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

Makes sense, thanks! 👍

@hlky
Copy link
Contributor

hlky commented Oct 23, 2024

LGTM!

@hanouticelina
Copy link
Contributor

I think we can merge this PR, thanks @tomaarsen!

@hanouticelina hanouticelina merged commit 6ac7aef into huggingface:main Oct 24, 2024
15 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.

5 participants