Spaces:
Sleeping
Sleeping
File size: 1,210 Bytes
59f9119 411756d 0bad483 0087504 0bad483 1e3f368 3d5f527 b6edac7 3d5f527 f02d809 b65e620 59f9119 0bad483 59f9119 c1c647b b43ecb8 9ebaadd 59f9119 02731e7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | FROM python:3.10
ENV CUDA_VISIBLE_DEVICES=-1
ARG PIP_NO_CACHE_DIR=1
# Install system dependencies, including Poppler
RUN apt-get update && apt-get install -y poppler-utils && rm -rf /var/lib/apt/lists/*
# Install specific version of numpy for compatibility
RUN pip install numpy==1.26.4
# Install pymongo for MongoDB Operations
RUN pip install pymongo
# Install JsonSchema for JSON Validation
RUN pip install jsonschema
#Install pdf2image dependency
RUN pip install --no-cache-dir pdf2image
# Install paddlepaddle (latest stable version)
RUN pip install paddlepaddle -i https://pypi.org/simple
# Install dependencies
RUN pip install torch==2.1.1 -i https://download.pytorch.org/whl/cpu
RUN pip install transformers fastapi pypdf2 fitz boto3 pillow openai==0.28 setuptools pymupdf python-dotenv uvicorn
# Install libGL (needed for OpenCV)
RUN apt-get update && apt-get install -y libgl1
RUN pip install paddleocr==2.7.0.3 && pip uninstall -y opencv-python opencv-contrib-python && pip install opencv-python
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user
WORKDIR $HOME/app
RUN mkdir output
COPY --chown=user app.py $HOME/app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|