diff --git a/Dockerfile b/Dockerfile index 3c85c43..5f9e4df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,9 +31,12 @@ COPY . . RUN pip install --no-cache-dir -r requirements.lock +# Set NLTK data directory environment variable explicitly +ENV NLTK_DATA=/usr/local/share/nltk_data + RUN playwright install --with-deps && \ - python -c "from unstructured.nlp.tokenize import download_nltk_packages; download_nltk_packages()" && \ - python -c "import nltk;nltk.download('punkt_tab'); nltk.download('averaged_perceptron_tagger_eng')" && \ + mkdir -p $NLTK_DATA && \ + python -c "import nltk; nltk.download('punkt', download_dir='$NLTK_DATA'); nltk.download('averaged_perceptron_tagger', download_dir='$NLTK_DATA')" && \ python -c "from unstructured.partition.model_init import initialize; initialize()" EXPOSE 8001 diff --git a/app.py b/app.py index f12fa25..e5ae9b1 100644 --- a/app.py +++ b/app.py @@ -151,6 +151,7 @@ class FileExtension(str, Enum): PPTX = ".pptx" PPT = ".ppt" JSON = ".json" + LOG = ".log" MD = ".md" MARKDOWN = ".markdown"