Update app.py
Browse files
app.py
CHANGED
@@ -202,16 +202,13 @@ def chat_word2vec_context(question, history):
|
|
202 |
return answer
|
203 |
|
204 |
#------------------------------------------------------------------------------------------------#
|
205 |
-
from sentence_transformers import SentenceTransformer
|
206 |
-
|
207 |
-
model = SentenceTransformer("elastic/multilingual-e5-small-optimized")
|
208 |
|
209 |
# Let's try bert model by elastic and with e5
|
210 |
-
model_name = "
|
211 |
device = "cpu"
|
212 |
|
213 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
214 |
-
|
215 |
|
216 |
class BERTSearchEngine:
|
217 |
def __init__(self, model, tokenizer):
|
|
|
202 |
return answer
|
203 |
|
204 |
#------------------------------------------------------------------------------------------------#
|
|
|
|
|
|
|
205 |
|
206 |
# Let's try bert model by elastic and with e5
|
207 |
+
model_name = "distilbert/distilbert-base-uncased"
|
208 |
device = "cpu"
|
209 |
|
210 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
211 |
+
model = AutoModel.from_pretrained(model_name)
|
212 |
|
213 |
class BERTSearchEngine:
|
214 |
def __init__(self, model, tokenizer):
|