Spaces:
Runtime error
Runtime error
rohithk-03
commited on
Commit
·
d08a67e
1
Parent(s):
75c33bc
update return msg
Browse files- Dockerfile +0 -33
- app.py +1 -0
Dockerfile
CHANGED
|
@@ -14,19 +14,12 @@ WORKDIR /app
|
|
| 14 |
COPY --chown=user ./requirements.txt requirements.txt
|
| 15 |
RUN pip install --no-cache-dir scikit-build
|
| 16 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 17 |
-
RUN pip install 'git+https://github.com/facebookresearch/detectron2.git'
|
| 18 |
|
| 19 |
|
| 20 |
-
# Copy application files
|
| 21 |
COPY --chown=user . /app
|
| 22 |
|
| 23 |
-
# Stage 2: CUDA and Detectron2
|
| 24 |
-
# FROM nvidia/cuda:11.1.1-cudnn8-devel-ubuntu18.04 as cuda
|
| 25 |
-
|
| 26 |
-
# Use noninteractive mode for apt-get
|
| 27 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 28 |
|
| 29 |
-
# Install system dependencies
|
| 30 |
USER root
|
| 31 |
RUN apt-get update && apt-get clean
|
| 32 |
RUN apt-get update && apt-get install -y --fix-missing \
|
|
@@ -38,39 +31,13 @@ RUN apt-get update && apt-get install -y --fix-missing \
|
|
| 38 |
wget \
|
| 39 |
sudo \
|
| 40 |
ninja-build
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
# Link Python and Pip commands
|
| 44 |
-
# RUN ln -sv /usr/bin/python3 /usr/bin/python && ln -sv /usr/bin/pip3 /usr/bin/pip
|
| 45 |
-
|
| 46 |
-
# # Copy dependencies from the base stage
|
| 47 |
-
# COPY --from=base /home/user/.local /home/user/.local
|
| 48 |
-
# COPY --from=base /app /app
|
| 49 |
-
|
| 50 |
-
# Install additional Python packages
|
| 51 |
RUN pip install --no-cache-dir scikit-build
|
| 52 |
# RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 53 |
RUN pip install --no-cache-dir tensorboard cmake onnx
|
| 54 |
-
RUN pip install --no-cache-dir 'git+https://github.com/facebookresearch/fvcore'
|
| 55 |
-
|
| 56 |
-
# # Clone Detectron2 repository
|
| 57 |
-
# RUN git clone https://github.com/facebookresearch/detectron2 detectron2_repo
|
| 58 |
-
|
| 59 |
-
# # Set environment variables for Detectron2
|
| 60 |
-
# ENV FORCE_CUDA="1"
|
| 61 |
-
# ARG TORCH_CUDA_ARCH_LIST="Kepler;Kepler+Tesla;Maxwell;Maxwell+Tegra;Pascal;Volta;Turing"
|
| 62 |
-
# ENV TORCH_CUDA_ARCH_LIST="${TORCH_CUDA_ARCH_LIST}"
|
| 63 |
-
# ENV FVCORE_CACHE="/tmp"
|
| 64 |
-
|
| 65 |
-
# # Install Detectron2 in editable mode
|
| 66 |
-
# RUN pip install --no-cache-dir -e detectron2_repo
|
| 67 |
-
|
| 68 |
-
# Set the working directory and environment
|
| 69 |
USER user
|
| 70 |
ENV HOME=/home/user
|
| 71 |
COPY --chown=user . $HOME/app
|
| 72 |
WORKDIR $HOME/app
|
| 73 |
|
| 74 |
-
# Expose application port and set default command
|
| 75 |
RUN ls -a
|
| 76 |
CMD ["python", "app.py"]
|
|
|
|
| 14 |
COPY --chown=user ./requirements.txt requirements.txt
|
| 15 |
RUN pip install --no-cache-dir scikit-build
|
| 16 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
|
|
| 17 |
|
| 18 |
|
|
|
|
| 19 |
COPY --chown=user . /app
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 22 |
|
|
|
|
| 23 |
USER root
|
| 24 |
RUN apt-get update && apt-get clean
|
| 25 |
RUN apt-get update && apt-get install -y --fix-missing \
|
|
|
|
| 31 |
wget \
|
| 32 |
sudo \
|
| 33 |
ninja-build
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
RUN pip install --no-cache-dir scikit-build
|
| 35 |
# RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 36 |
RUN pip install --no-cache-dir tensorboard cmake onnx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
USER user
|
| 38 |
ENV HOME=/home/user
|
| 39 |
COPY --chown=user . $HOME/app
|
| 40 |
WORKDIR $HOME/app
|
| 41 |
|
|
|
|
| 42 |
RUN ls -a
|
| 43 |
CMD ["python", "app.py"]
|
app.py
CHANGED
|
@@ -197,6 +197,7 @@ def generate_report():
|
|
| 197 |
file = request.files["file"]
|
| 198 |
with open("uploaded_report.pdf", "wb") as f:
|
| 199 |
f.write(file.read())
|
|
|
|
| 200 |
|
| 201 |
|
| 202 |
if __name__ == "__main__":
|
|
|
|
| 197 |
file = request.files["file"]
|
| 198 |
with open("uploaded_report.pdf", "wb") as f:
|
| 199 |
f.write(file.read())
|
| 200 |
+
return jsonify({"message": "Something happened!."})
|
| 201 |
|
| 202 |
|
| 203 |
if __name__ == "__main__":
|