Skip to content

Conversation

@julien-c
Copy link
Member

No description provided.

@julien-c julien-c merged commit a1ac82e into main Dec 22, 2020
@julien-c julien-c deleted the spin_off branch December 22, 2020 21:43
julien-c pushed a commit that referenced this pull request May 21, 2021
- Correct Spanish translation of default examples
commit imported from https://github.com/huggingface/widgets/commit/124bd3fd84f21976bdc088d25714ef5e09a5906f

- Correct Spanish translation of default examples
julien-c pushed a commit that referenced this pull request May 21, 2021
- Correct Spanish translation of default examples
commit imported from https://github.com/huggingface/widgets/commit/124bd3fd84f21976bdc088d25714ef5e09a5906f

- Correct Spanish translation of default examples
LysandreJik added a commit that referenced this pull request May 18, 2022
* ENH lazy load modules in the root __init__

* add link to the original repo of the vendored file

* move function to __init__

* Add warning when module/attr have same name (#1)

* rename snapshot_download.py -> _snapshot_download.py

* update docs

Co-authored-by: Lysandre Debut <[email protected]>

* update docs

Co-authored-by: Lysandre Debut <[email protected]>

* update docs

Co-authored-by: Lysandre Debut <[email protected]>

Co-authored-by: Stefan van der Walt <[email protected]>
Co-authored-by: Lysandre Debut <[email protected]>
WilliamRabuel added a commit to WilliamRabuel/huggingface_hub that referenced this pull request Jul 19, 2025
I discover a problem (even lots of problems...) when I wanted to use push_to_hub on an agent of smolagents, and the problem is due to huggingface_hub, in the file :

Bug huggingface#1: UnicodeEncodeError when creating README.md
Error:
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f440' (for exemple) in position 32: character maps to <undefined>

Root cause:
Location: Path.write_text() in huggingface_hub/repocard.py:279
Problem: Windows uses CP1252 encoding by default instead of UTF-8
Trigger: A Unicode emoji (\U0001f440 = 👀 for exemple) in the README.md metadata

Context:
smolagents automatically generates a README.md with emojis, but Windows cannot encode them using CP1252

Bug mechanism:
agent.push_to_hub() calls metadata_update()
metadata_update() creates a RepoCard with an emoji
RepoCard.push_to_hub() uses Path.write_text() without specifying UTF-8
Windows defaults to CP1252 → crash on emoji

Solution:
So I juste use encoding="utf-8" in write_text()
WilliamRabuel added a commit to WilliamRabuel/huggingface_hub that referenced this pull request Jul 20, 2025
I discover a problem (even lots of problems...) when I wanted to use push_to_hub on an agent of smolagents, and the problem is due to huggingface_hub, in the file :

Bug huggingface#1: UnicodeEncodeError when creating README.md
Error:
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f440' (for exemple) in position 32: character maps to <undefined>

Root cause:
Location: Path.write_text() in huggingface_hub/repocard.py:279
Problem: Windows uses CP1252 encoding by default instead of UTF-8
Trigger: A Unicode emoji (\U0001f440 = 👀 for exemple) in the README.md metadata

Context:
smolagents automatically generates a README.md with emojis, but Windows cannot encode them using CP1252

Bug mechanism:
agent.push_to_hub() calls metadata_update()
metadata_update() creates a RepoCard with an emoji
RepoCard.push_to_hub() uses Path.write_text() without specifying UTF-8
Windows defaults to CP1252 → crash on emoji

Solution:
So I juste use encoding="utf-8" in write_text()
Wauplin pushed a commit that referenced this pull request Jul 21, 2025
I discover a problem (even lots of problems...) when I wanted to use push_to_hub on an agent of smolagents, and the problem is due to huggingface_hub, in the file :

Bug #1: UnicodeEncodeError when creating README.md
Error:
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f440' (for exemple) in position 32: character maps to <undefined>

Root cause:
Location: Path.write_text() in huggingface_hub/repocard.py:279
Problem: Windows uses CP1252 encoding by default instead of UTF-8
Trigger: A Unicode emoji (\U0001f440 = 👀 for exemple) in the README.md metadata

Context:
smolagents automatically generates a README.md with emojis, but Windows cannot encode them using CP1252

Bug mechanism:
agent.push_to_hub() calls metadata_update()
metadata_update() creates a RepoCard with an emoji
RepoCard.push_to_hub() uses Path.write_text() without specifying UTF-8
Windows defaults to CP1252 → crash on emoji

Solution:
So I juste use encoding="utf-8" in write_text()
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