From 97f316e68cf0041b7b1cd84439ed47ce4a093468 Mon Sep 17 00:00:00 2001 From: Weves Date: Thu, 25 Apr 2024 11:20:09 -0700 Subject: [PATCH] Testing --- .../docker-build-push-backend-container-on-tag.yml | 9 --------- .../docker-build-push-model-server-container-on-tag.yml | 7 ------- .../workflows/docker-build-push-web-container-on-tag.yml | 7 ------- backend/model_server/custom_models.py | 6 ++++++ 4 files changed, 6 insertions(+), 23 deletions(-) diff --git a/.github/workflows/docker-build-push-backend-container-on-tag.yml b/.github/workflows/docker-build-push-backend-container-on-tag.yml index a7d46a09736..2c5fa509d45 100644 --- a/.github/workflows/docker-build-push-backend-container-on-tag.yml +++ b/.github/workflows/docker-build-push-backend-container-on-tag.yml @@ -31,14 +31,5 @@ jobs: push: true tags: | danswer/danswer-backend:${{ github.ref_name }} - danswer/danswer-backend:latest build-args: | DANSWER_VERSION=${{ github.ref_name }} - - - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@master - with: - # To run locally: trivy image --severity HIGH,CRITICAL danswer/danswer-backend - image-ref: docker.io/danswer/danswer-backend:${{ github.ref_name }} - severity: 'CRITICAL,HIGH' - trivyignores: ./backend/.trivyignore diff --git a/.github/workflows/docker-build-push-model-server-container-on-tag.yml b/.github/workflows/docker-build-push-model-server-container-on-tag.yml index ddc5f5a280c..2a50bb32b11 100644 --- a/.github/workflows/docker-build-push-model-server-container-on-tag.yml +++ b/.github/workflows/docker-build-push-model-server-container-on-tag.yml @@ -31,12 +31,5 @@ jobs: push: true tags: | danswer/danswer-model-server:${{ github.ref_name }} - danswer/danswer-model-server:latest build-args: | DANSWER_VERSION=${{ github.ref_name }} - - - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@master - with: - image-ref: docker.io/danswer/danswer-model-server:${{ github.ref_name }} - severity: 'CRITICAL,HIGH' diff --git a/.github/workflows/docker-build-push-web-container-on-tag.yml b/.github/workflows/docker-build-push-web-container-on-tag.yml index d848fc1892c..80cd13ba9d6 100644 --- a/.github/workflows/docker-build-push-web-container-on-tag.yml +++ b/.github/workflows/docker-build-push-web-container-on-tag.yml @@ -31,12 +31,5 @@ jobs: push: true tags: | danswer/danswer-web-server:${{ github.ref_name }} - danswer/danswer-web-server:latest build-args: | DANSWER_VERSION=${{ github.ref_name }} - - - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@master - with: - image-ref: docker.io/danswer/danswer-web-server:${{ github.ref_name }} - severity: 'CRITICAL,HIGH' diff --git a/backend/model_server/custom_models.py b/backend/model_server/custom_models.py index ee97ded7843..33884ec2332 100644 --- a/backend/model_server/custom_models.py +++ b/backend/model_server/custom_models.py @@ -3,8 +3,10 @@ import numpy as np import tensorflow as tf # type: ignore from fastapi import APIRouter +from huggingface_hub.constants import HF_HOME from transformers import AutoTokenizer # type: ignore from transformers import TFDistilBertForSequenceClassification +from transformers.utils import TRANSFORMERS_CACHE from model_server.constants import MODEL_WARM_UP_STRING from model_server.utils import simple_log_function_time @@ -24,6 +26,8 @@ def get_intent_model_tokenizer( model_name: str = INTENT_MODEL_VERSION, ) -> "AutoTokenizer": + print(f"HF Home: {HF_HOME}") + print(f"Cache dir: {TRANSFORMERS_CACHE}") global _INTENT_TOKENIZER if _INTENT_TOKENIZER is None: _INTENT_TOKENIZER = AutoTokenizer.from_pretrained(model_name) @@ -36,6 +40,8 @@ def get_local_intent_model( ) -> TFDistilBertForSequenceClassification: global _INTENT_MODEL if _INTENT_MODEL is None or max_context_length != _INTENT_MODEL.max_seq_length: + print(f"HF Home: {HF_HOME}") + print(f"Cache dir: {TRANSFORMERS_CACHE}") _INTENT_MODEL = TFDistilBertForSequenceClassification.from_pretrained( model_name )