fix: Drop the Dead NLTK Download That Breaks Image Builds - #329
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every image build on
mainhas failed since52989197bumpedunstructuredfrom 0.18.32 to 0.27.8. Both Dockerfiles run a step that downloads NLTK data, and it now dies withModuleNotFoundError: No module named 'nltk'(failed job). Nothing is being published tolibrechat-rag-api-devor-dev-liteuntil this lands.unstructured0.18.32 declarednltkas a dependency; 0.27.8 does not. That is not an oversight on their side: 0.27.8 no longer uses NLTK at all. It ships its ownsent_tokenize,word_tokenizeandpos_taginunstructured/nlp/tokenize.py, and none of its 138 modules mention NLTK. This repository's own code never imported it either.So the step is dead weight rather than a missing dependency. This removes it, along with the
NLTK_DATAvariable, from bothDockerfileandDockerfile.lite, instead of reinstalling NLTK and downloading data nothing reads.How it works
Same change in both files. The images also get smaller, since they no longer carry the punkt and tagger data.
Testing
unstructured0.18.32requires_distincludesnltk; 0.27.8 lists none.import nltk, no reference to it at all.app/here: no NLTK usage.main, not on pull requests, so the first build after merge is what confirms it.