Skip to content

[docs] Whitespace#1785

Merged
Narsil merged 8 commits intohuggingface:mainfrom
stevhliu:whitespace
Jun 17, 2025
Merged

[docs] Whitespace#1785
Narsil merged 8 commits intohuggingface:mainfrom
stevhliu:whitespace

Conversation

@stevhliu
Copy link
Copy Markdown
Member

@stevhliu stevhliu commented May 27, 2025

Improves documentation for the Whitespace function (see huggingface/transformers#38180 for more details)

cc @itazap

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

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.

@stevhliu stevhliu requested a review from ArthurZucker May 27, 2025 23:14
Copy link
Copy Markdown
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Nice thanks 🤗

@ArthurZucker
Copy link
Copy Markdown
Collaborator

You need to run python stub.py !

@itazap
Copy link
Copy Markdown

itazap commented May 28, 2025

Awesome! 💯

@stevhliu
Copy link
Copy Markdown
Member Author

Hmm, having a bit of trouble here? 😅

  • I had to make some changes because running python stub.py gives the error python: can't open file '/Users/stevhliu/tokenizers/stub.py': [Errno 2] No such file or directory.
  • Instead, I run the command python bindings/python/stub.py and it creates a new py_src/tokenizers/ directory (with a bunch of empty files) instead of writing the changes to the existing one.
  • So I modify stub.py to write the changes to "bindings/python/py_src/tokenizers/" but then it just overwrites and replaces everything in those files with a blank line which doesn't seem right.

@Narsil Narsil merged commit 2658dd2 into huggingface:main Jun 17, 2025
26 of 28 checks passed
@Narsil
Copy link
Copy Markdown
Contributor

Narsil commented Jun 17, 2025

I'll merge this a fix in a follow-up stub.py is right even if it's just a newline.

@Narsil
Copy link
Copy Markdown
Contributor

Narsil commented Jun 17, 2025

Oh you may have forgotten to rebuild tokenizers, stub.py looks at the binary and extracts the pyi from the built binary, so if your binary is outdated you may not see the new strings.

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