Skip to content

Conversation

@Nsumithreddy
Copy link

Hi @kyleesays,

This PR is for Issue #2007.

I fixed the tokenizer warning by adding the os.environ["TOKENIZERS_PARALLELISM"] = "false" line to the src/llmcompressor/__init__.py file, like you suggested.

I couldn't get the warning to happen on my computer, but this fix should work.

Thanks.

@github-actions
Copy link

👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review.

Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to fix a tokenizer warning by setting TOKENIZERS_PARALLELISM to false. While this is a valid workaround for the warning, setting an environment variable directly in the library's __init__.py is not ideal as it creates a global side-effect for any user importing the library. My review includes a suggestion to handle this in a less invasive way, improving the library's behavior as a dependency in other projects.

@vllm-project vllm-project deleted a comment from gemini-code-assist bot Nov 10, 2025
@kylesayrs
Copy link
Collaborator

Hi @Nsumithreddy, thanks for the diff!

I think that having LLM Compressor set environment variables is not good practice, as it has side effects for other tokenizer issues. Instead, I think it's important to figure out the source of these warnings. If a change needs to be made, we can include it in the example scripts with a quick explanation as to why these warnings happen and why the environment variable change is required.

@kylesayrs kylesayrs marked this pull request as draft November 12, 2025 16:49
@kylesayrs
Copy link
Collaborator

Closing because I don't think having LLM Compressor set 3rd party environment variables is the correct approach. Feel free to open another PR once we know what is triggering the warning and whether we should add anything to the example scripts

@kylesayrs kylesayrs closed this Nov 14, 2025
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