diff --git a/api/.dockerignore b/api/.dockerignore index 0ff5fcd..5fdbf5b 100644 --- a/api/.dockerignore +++ b/api/.dockerignore @@ -1,13 +1,11 @@ -bin +__pycache__/ +bin/ +lib/ build -Dockerfile-alpine -lib -__pycache__ -*/__pycache__ -*/*/__pycache__ -*/*/*/__pycache__ +run +*/__pycache__/ +*/*/__pycache__/ +*/*/*/__pycache__/ pyvenv.cfg readme.md -run -test -chatbots_api.tar.gz +chatbots_* diff --git a/api/Dockerfile b/api/Dockerfile index ad702ae..11a9eee 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -3,6 +3,6 @@ FROM python:3.10-slim WORKDIR /app COPY requirements.txt requirements.txt ENV PYTHONUNBUFFERED=1 -RUN python3 -m pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt COPY . . CMD [ "uvicorn", "chatbots:api", "--proxy-headers", "--host", "0.0.0.0", "--port", "8000", "--reload"] diff --git a/api/build b/api/build index 249fdc6..16bb074 100755 --- a/api/build +++ b/api/build @@ -1,5 +1,11 @@ #!/bin/bash -docker build --tag chatbots_api . -docker save chatbots_api | pigz > chatbots_api_$(uname -m).tar.gz +FILE_PATH="../chatbots_api_$(uname -m).tar.gz" + +if [ -f $FILE_PATH ]; then + rm $FILE_PATH +fi + +docker build --tag chatbots_api . +docker save chatbots_api | pigz > $FILE_PATH diff --git a/api/requirements.txt b/api/requirements.txt index b5abfc4..3349917 100644 --- a/api/requirements.txt +++ b/api/requirements.txt @@ -1,5 +1,5 @@ fastapi uvicorn transformers ---extra-index-url https://download.pytorch.org/whl/cpu/torch +--extra-index-url https://download.pytorch.org/whl/cpu torch diff --git a/api/src/bots/cartman.py b/api/src/bots/cartman.py index df6b7b8..6aad057 100644 --- a/api/src/bots/cartman.py +++ b/api/src/bots/cartman.py @@ -7,7 +7,7 @@ tokenizer = AutoTokenizer.from_pretrained( "microsoft/DialoGPT-large", padding_side='left' ) model = AutoModelForCausalLM.from_pretrained( - "src/bots/cartman" + "src/bots/cartman_med_3ep" )