diff --git a/..gitattributes.swp b/..gitattributes.swp new file mode 100644 index 0000000..32fa149 Binary files /dev/null and b/..gitattributes.swp differ diff --git a/backend/Dockerfile b/backend/Dockerfile index 6c69510..a88a919 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -15,6 +15,10 @@ RUN pip install torchvision==0.2.1 -f https://download.pytorch.org/whl/torch_sta RUN git clone https://github.com/UKPLab/emnlp2017-bilstm-cnn-crf.git RUN mv backend.py emnlp2017-bilstm-cnn-crf/ && mv Model.py emnlp2017-bilstm-cnn-crf/ && mv ModelNewES.py emnlp2017-bilstm-cnn-crf/ && mv ModelNewWD.py emnlp2017-bilstm-cnn-crf/ && mv Segmenter.py emnlp2017-bilstm-cnn-crf/ +# Download the .h5 file to the models directory +# Download the .h5 file +RUN wget -q --show-progress -O models/IBM.h5 "https://huggingface.co/debela-arg/segmenter/resolve/main/IBM.h5?download=true" || \ + (echo "Download failed! Check URL or authentication." && exit 1) RUN mv models/* emnlp2017-bilstm-cnn-crf/models/ diff --git a/backend/Dockerfile2 b/backend/Dockerfile2 new file mode 100644 index 0000000..98c5d55 --- /dev/null +++ b/backend/Dockerfile2 @@ -0,0 +1,49 @@ +# Use an official Python runtime as a parent image +FROM python:3.5 + +# Add all Data +ADD . / + +# Set the working directory to / +WORKDIR / + +# Install any needed packages specified in requirements.txt +RUN pip install -r requirements.txt +RUN pip install torch==0.4.1 -f https://download.pytorch.org/whl/torch_stable.html +RUN pip install torchvision==0.2.1 -f https://download.pytorch.org/whl/torch_stable.html + +RUN git clone https://github.com/UKPLab/emnlp2017-bilstm-cnn-crf.git + +RUN mv backend.py emnlp2017-bilstm-cnn-crf/ && mv Model.py emnlp2017-bilstm-cnn-crf/ && mv ModelNewES.py emnlp2017-bilstm-cnn-crf/ && mv ModelNewWD.py emnlp2017-bilstm-cnn-crf/ && mv Segmenter.py emnlp2017-bilstm-cnn-crf/ && mv data.py emnlp2017-bilstm-cnn-crf/ && mv main.py emnlp2017-bilstm-cnn-crf/ + +# Download the .h5 file to the models directory +RUN wget -O backend/models/IBM.h5 https://huggingface.co/debela-arg/segmenter/raw/main/IBM.h5 + + +RUN mv models/* emnlp2017-bilstm-cnn-crf/models/ + +RUN mv -f BiLSTM.py emnlp2017-bilstm-cnn-crf/neuralnets/ + +RUN mkdir emnlp2017-bilstm-cnn-crf/lstm + +RUN git clone https://github.com/achernodub/bilstm-cnn-crf-tagger.git emnlp2017-bilstm-cnn-crf/lstm +RUN pip install prometheus-flask-exporter==0.1.2 +RUN pip install requests + + +# Make port 6000 available to the world outside this container +EXPOSE 6000 + +WORKDIR /emnlp2017-bilstm-cnn-crf + +# Run app.py when the container launches +CMD ["python3", "main.py"] + + + + + + + + + diff --git a/backend/models/IBM.h5 b/backend/models/IBM.h5 deleted file mode 100644 index 8fe75f3..0000000 --- a/backend/models/IBM.h5 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:00f712b8fed25f6e5f3da3645f2283ce35f58722aab10d30b9dbb59731beb5c4 -size 1227276896