From f168960d540ea24aa48635bb095426084442f0cc Mon Sep 17 00:00:00 2001 From: Marcin Antas Date: Sun, 28 May 2023 20:56:44 +0200 Subject: [PATCH 1/3] Add support for Bar-Ilan University NLP Lab models --- .github/workflows/main.yaml | 4 ++++ .gitignore | 2 ++ README.md | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 20fa2e9..691385a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -54,6 +54,10 @@ jobs: model_tag_name: google-flan-t5-base - model_name: google/flan-t5-large model_tag_name: google-flan-t5-large + - model_name: biu-nlp/abstract-sim-sentence + model_tag_name: biu-nlp-abstract-sim-sentence + - model_name: biu-nlp/abstract-sim-query + model_tag_name: biu-nlp-abstract-sim-query env: LOCAL_REPO: transformers-inference REMOTE_REPO: semitechnologies/transformers-inference diff --git a/.gitignore b/.gitignore index 6cf09be..28247b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ __pycache__ models nltk_data +.venv/ +.vscode/ diff --git a/README.md b/README.md index 251b6dc..633a7bc 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,9 @@ The pre-built models include: |`facebook/dpr-question_encoder-single-nq-base` ([Info](https://huggingface.co/facebook/dpr-question_encoder-single-nq-base))|`semitechnologies/transformers-inference:facebook-dpr-question_encoder-single-nq-base`| |`vblagoje/dpr-ctx_encoder-single-lfqa-wiki` ([Info](https://huggingface.co/vblagoje/dpr-ctx_encoder-single-lfqa-wiki))|`semitechnologies/transformers-inference:vblagoje-dpr-ctx_encoder-single-lfqa-wiki`| |`vblagoje/dpr-question_encoder-single-lfqa-wiki` ([Info](https://huggingface.co/vblagoje/dpr-question_encoder-single-lfqa-wiki))|`semitechnologies/transformers-inference:vblagoje-dpr-question_encoder-single-lfqa-wiki`| +|Bar-Ilan University NLP Lab Models| +|`biu-nlp/abstract-sim-sentence` ([Info](https://huggingface.co/biu-nlp/abstract-sim-sentence))|`semitechnologies/transformers-inference:biu-nlp-abstract-sim-sentence`| +|`biu-nlp/abstract-sim-query` ([Info](https://huggingface.co/biu-nlp/abstract-sim-query))|`semitechnologies/transformers-inference:biu-nlp-abstract-sim-query`| The above image names always point to the latest version of the inference From 26be9ed74d48bff7488561150db2c097620f276b Mon Sep 17 00:00:00 2001 From: Marcin Antas Date: Sun, 28 May 2023 22:16:47 +0200 Subject: [PATCH 2/3] Update python dependencies --- requirements.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 4cdb707..79e44ea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -transformers==4.27.2 -fastapi==0.95.0 -uvicorn==0.21.1 +transformers==4.29.2 +fastapi==0.95.2 +uvicorn==0.22.0 nltk==3.8.1 -torch==2.0.0 -sentencepiece==0.1.97 +torch==2.0.1 +sentencepiece==0.1.99 From 02dae4ffb61fa8f3080829ebecd454526042b415 Mon Sep 17 00:00:00 2001 From: Marcin Antas Date: Mon, 29 May 2023 07:51:25 +0200 Subject: [PATCH 3/3] fix bash scripts to propagate exit codes properly --- .github/workflows/main.yaml | 8 ++++---- cicd/build.sh | 2 +- cicd/build_custom_base.sh | 2 +- cicd/docker_push.sh | 2 +- cicd/test.sh | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 691385a..8b9a8c9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -77,8 +77,8 @@ jobs: password: ${{secrets.DOCKER_PASSWORD}} - name: Build and test run: | - cicd/build.sh || exit 1 - cicd/test.sh || exit 1 + cicd/build.sh + cicd/test.sh - name: Deploy if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') env: @@ -86,7 +86,7 @@ jobs: DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} run: | export GIT_TAG=${GITHUB_REF##*/} - cicd/docker_push.sh || exit 1 + cicd/docker_push.sh build-custom-image: name: Build custom image runs-on: ubuntu-latest @@ -111,4 +111,4 @@ jobs: DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} run: | export GIT_TAG=${GITHUB_REF##*/} - cicd/build_custom_base.sh || exit 1 + cicd/build_custom_base.sh diff --git a/cicd/build.sh b/cicd/build.sh index b9ed910..713b698 100755 --- a/cicd/build.sh +++ b/cicd/build.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e +set -eou pipefail local_repo=${LOCAL_REPO?Variable LOCAL_REPO is required} model_name=${MODEL_NAME?Variable MODEL_NAME is required} diff --git a/cicd/build_custom_base.sh b/cicd/build_custom_base.sh index f79a13d..f2f546a 100755 --- a/cicd/build_custom_base.sh +++ b/cicd/build_custom_base.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e +set -eou pipefail function build() { docker build -f custom.Dockerfile -t "custom-base" . diff --git a/cicd/docker_push.sh b/cicd/docker_push.sh index c3efa63..38d6208 100755 --- a/cicd/docker_push.sh +++ b/cicd/docker_push.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e pipefail +set -eou pipefail # Docker push rules # If not on main diff --git a/cicd/test.sh b/cicd/test.sh index e452e5e..4fd5c4b 100755 --- a/cicd/test.sh +++ b/cicd/test.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e +set -eou pipefail local_repo=${LOCAL_REPO?Variable LOCAL_REPO is required}