Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 28, 2025

Removes the eprintln! calls in child_after_fork() that print warnings to stderr when forking after parallelism has been used. The deadlock prevention behavior (set_parallelism(false)) is preserved.

Changes:

  • Removed three eprintln! statements from bindings/python/src/lib.rs (ref: a05b60c55f29814631b0b0c92ba51b178cc126f6#L47)
  • Updated comment to reflect that callback now silently disables parallelism

Before:

if has_parallelism_been_used() && !is_parallelism_configured() {
    eprintln!("huggingface/tokenizers: The current process just got forked...");
    eprintln!("To disable this warning, you can either:");
    eprintln!("\t- Avoid using `tokenizers` before the fork...");
    set_parallelism(false);
}

After:

if has_parallelism_been_used() && !is_parallelism_configured() {
    set_parallelism(false);
}

Note: If logging is desired in the future, the existing env_logger integration (TOKENIZERS_LOG) could be used instead of direct stderr writes.

Original prompt

Remove the runtime stderr warning emitted by the Python bindings. The file bindings/python/src/lib.rs at commit a05b60c prints a runtime warning to stderr via an eprintln! call (see

). The user requested that this warning be removed entirely.

Tasks for the coding agent:

  • Create a new branch and commit that removes the eprintln!(...) call that prints the runtime warning in bindings/python/src/lib.rs. Do not change any other behavior or add additional logging; remove the warning entirely.
  • Keep surrounding code and formatting intact; only remove the eprintln! invocation and any extraneous trailing blank lines introduced by the removal.
  • Ensure the repository builds (run cargo build or the project's recommended build command) so the change doesn't break compilation. If build failures are unrelated, report them in the PR description.
  • Open a pull request against the repository (target branch: repository default branch) with the title: "Remove runtime stderr warning from Python bindings" and the description explaining what was removed and why (avoid mentioning the user as assignee). The PR description should include:
    • File changed: bindings/python/src/lib.rs
    • Commit OID referenced: a05b60c
    • Exact change: removed the eprintln!(...) call that printed a runtime warning to stderr
    • Verification steps taken (build/tests run)

Do not include any unrelated changes or refactors. Do not assign the PR to anyone. If there are follow-up suggestions (e.g., migrating this message to proper logging), include them as optional notes in the PR description but do not implement them.

This pull request was created as a result of the following prompt from Copilot chat.

Remove the runtime stderr warning emitted by the Python bindings. The file bindings/python/src/lib.rs at commit a05b60c prints a runtime warning to stderr via an eprintln! call (see

). The user requested that this warning be removed entirely.

Tasks for the coding agent:

  • Create a new branch and commit that removes the eprintln!(...) call that prints the runtime warning in bindings/python/src/lib.rs. Do not change any other behavior or add additional logging; remove the warning entirely.
  • Keep surrounding code and formatting intact; only remove the eprintln! invocation and any extraneous trailing blank lines introduced by the removal.
  • Ensure the repository builds (run cargo build or the project's recommended build command) so the change doesn't break compilation. If build failures are unrelated, report them in the PR description.
  • Open a pull request against the repository (target branch: repository default branch) with the title: "Remove runtime stderr warning from Python bindings" and the description explaining what was removed and why (avoid mentioning the user as assignee). The PR description should include:
    • File changed: bindings/python/src/lib.rs
    • Commit OID referenced: a05b60c
    • Exact change: removed the eprintln!(...) call that printed a runtime warning to stderr
    • Verification steps taken (build/tests run)

Do not include any unrelated changes or refactors. Do not assign the PR to anyone. If there are follow-up suggestions (e.g., migrating this message to proper logging), include them as optional notes in the PR description but do not implement them.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Remove the eprintln! calls that printed a runtime warning to stderr
when the process was forked after parallelism had been used. The
set_parallelism(false) behavior is preserved to avoid deadlocks.

File changed: bindings/python/src/lib.rs
Commit OID referenced: a05b60c

Co-authored-by: ArthurZucker <[email protected]>
@ArthurZucker
Copy link
Collaborator

Lol cc @sgugger as you requested it :)

@ArthurZucker ArthurZucker marked this pull request as ready for review November 28, 2025 11:08
The comment now correctly states that the callback disables parallelism
instead of warning the user.

Co-authored-by: ArthurZucker <[email protected]>
Copilot AI changed the title [WIP] Remove stderr warning from Python bindings Remove runtime stderr warning from Python bindings Nov 28, 2025
Copilot AI requested a review from ArthurZucker November 28, 2025 11:12
@ArthurZucker ArthurZucker merged commit 09dafe2 into main Nov 28, 2025
58 checks passed
@ArthurZucker ArthurZucker deleted the copilot/remove-runtime-stderr-warning branch November 28, 2025 12:52
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