Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/models.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
from sentence_transformers import SentenceTransformer, CrossEncoder
from transformers import pipeline
import torch

import nltk

bi_encoder = SentenceTransformer('multi-qa-MiniLM-L6-cos-v1')

cross_encoder_small = CrossEncoder('cross-encoder/ms-marco-TinyBERT-L-2-v2')
cross_encoder_large = CrossEncoder('cross-encoder/ms-marco-MiniLM-L-6-v2')

qa_model = pipeline('question-answering', model='deepset/roberta-base-squad2')

nltk.download('punkt')
1 change: 0 additions & 1 deletion app/search_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
BI_ENCODER_CANDIDATES = 60 if torch.cuda.is_available() else 20
SMALL_CROSS_ENCODER_CANDIDATES = 30 if torch.cuda.is_available() else 10

nltk.download('punkt')
logger = logging.getLogger(__name__)


Expand Down