Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence nltk downloader #17816

Merged
merged 1 commit into from
Feb 14, 2025
Merged

Silence nltk downloader #17816

merged 1 commit into from
Feb 14, 2025

Conversation

jcgiuffrida
Copy link
Contributor

@jcgiuffrida jcgiuffrida commented Feb 14, 2025

Description

The nltk downloader prints unnecessarily to the console unless it is set to quiet=True. Because it uses print, it cannot be silenced using logging. The GlobalsHelper does not set quiet=True, so every project that uses llama_index.core.utils has messages like this printing to the console, all the time:

>>> from llama_index import core
[nltk_data] Downloading package punkt_tab to
[nltk_data]     /home/my_project/nltk_data...
[nltk_data]   Package punkt_tab is already up-to-date!

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • I believe this change is already covered by existing unit tests

Checklist:

  • I have performed a self-review of my own code
  • My changes generate no new warnings

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Feb 14, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 14, 2025
@logan-markewich logan-markewich enabled auto-merge (squash) February 14, 2025 04:24
@logan-markewich logan-markewich merged commit 93ba0d5 into run-llama:main Feb 14, 2025
7 of 11 checks passed
@jcgiuffrida jcgiuffrida deleted the patch-2 branch February 14, 2025 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants