Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serving #55

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions dockerfiles/web.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM pytorch/pytorch:2.1.2-cuda12.1-cudnn8-runtime

WORKDIR /

RUN apt update && \
apt install --no-install-recommends -y build-essential gcc && \
apt clean && rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install -y nano

COPY toxic_comments/slowapi/requirements.txt /

RUN pip install -r requirements.txt --no-cache-dir

COPY toxic_comments/ toxic_comments/
COPY /toxic_comments/slowapi /slowapi
COPY models/bert-toxic-classifier/models_bert-toxic-classifier_epoch=1-val_loss=0.15.ckpt models/bert-toxic-classifier/

ENV PYTHONPATH=/

EXPOSE 5000

#ENTRYPOINT [ "python" ]
#CMD [ "slowapi/ask.py" ]

#docker run -p 5000:5000 name_of_your_image
#docker run -p 8000:80 hosting uvicorn slowapi.main:app --host 0.0.0.0 --port 80
#change run.app(host='0.0.0.0', port=5000)
5 changes: 5 additions & 0 deletions flaskbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-f', './dockerfiles/web.dockerfile', '-t', 'gcr.io/propane-facet-410709/flask-inference', '.', '--no-cache']
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/propane-facet-410709/flask-inference']
Loading
Loading