Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Weves committed Apr 25, 2024
1 parent 648f2d0 commit f145685
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions backend/model_server/custom_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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
)
Expand Down

0 comments on commit f145685

Please sign in to comment.