Model Server CVEs (#898)

This commit is contained in:
Yuhong Sun
2023-12-29 21:14:08 -08:00
committed by GitHub
parent b352d83b8c
commit 2e6be57880
6 changed files with 18 additions and 5 deletions

View File

@@ -4,12 +4,14 @@ from fastapi import APIRouter
from danswer.search.search_nlp_models import get_intent_model_tokenizer
from danswer.search.search_nlp_models import get_local_intent_model
from danswer.utils.timing import log_function_time
from shared_models.model_server_models import IntentRequest
from shared_models.model_server_models import IntentResponse
router = APIRouter(prefix="/custom")
@log_function_time(print_only=True)
def classify_intent(query: str) -> list[float]:
tokenizer = get_intent_model_tokenizer()
intent_model = get_local_intent_model()