mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-12 14:12:53 +02:00
Telemetry Revision (#868)
This commit is contained in:
@ -4,14 +4,12 @@ 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()
|
||||
def classify_intent(query: str) -> list[float]:
|
||||
tokenizer = get_intent_model_tokenizer()
|
||||
intent_model = get_local_intent_model()
|
||||
|
@ -20,7 +20,7 @@ WARM_UP_STRING = "Danswer is amazing"
|
||||
router = APIRouter(prefix="/encoder")
|
||||
|
||||
|
||||
@log_function_time()
|
||||
@log_function_time(print_only=True)
|
||||
def embed_text(
|
||||
texts: list[str],
|
||||
normalize_embeddings: bool = NORMALIZE_EMBEDDINGS,
|
||||
@ -34,7 +34,7 @@ def embed_text(
|
||||
return embeddings
|
||||
|
||||
|
||||
@log_function_time()
|
||||
@log_function_time(print_only=True)
|
||||
def calc_sim_scores(query: str, docs: list[str]) -> list[list[float]]:
|
||||
cross_encoders = get_local_reranking_model_ensemble()
|
||||
sim_scores = [
|
||||
|
Reference in New Issue
Block a user