mirror of
https://github.com/UiO-Gaming/mustafa.git
synced 2026-11-05 13:56:48 +01:00
download NLTK stopword at image build time instead of container boot
This commit is contained in:
1 parent
3c85452aed
commit
196cb8a65b
2 files changed
+5
No files matched your search
@@ -12,6 +12,8 @@ COPY pyproject.toml uv.lock .python-version ./
|
||||
|
||||
RUN uv sync --locked --no-dev --no-cache
|
||||
|
||||
RUN .venv/bin/python -m nltk.downloader -d /usr/local/share/nltk_data stopwords
|
||||
|
||||
COPY . .
|
||||
|
||||
ENV PATH="/app/.venv/bin:$PATH"
|
||||
|
||||
@@ -45,6 +45,9 @@ class WordCloud(commands.Cog):
|
||||
self.consenting_users = []
|
||||
self.populate_consenting_users()
|
||||
|
||||
try:
|
||||
nltk.data.find("corpora/stopwords")
|
||||
except LookupError:
|
||||
nltk.download("stopwords")
|
||||
|
||||
self.insert_cache_loop.start()
|
||||
|
||||
Reference in new issue
Block a user