Spaces:
Runtime error
Runtime error
Chertushkin
commited on
Commit
•
28fab82
1
Parent(s):
9abf1d0
Fix Search
Browse files
backend/semantic_search.py
CHANGED
@@ -3,6 +3,7 @@ import lancedb
|
|
3 |
import os
|
4 |
from pathlib import Path
|
5 |
from sentence_transformers import SentenceTransformer
|
|
|
6 |
|
7 |
# EMB_MODEL_NAME = "sentence-transformers/all-MiniLM-L6-v2"
|
8 |
EMB_MODEL_NAME = "jinaai/jina-embeddings-v2-base-en"
|
@@ -11,6 +12,7 @@ DB_TABLE_NAME = "chunks"
|
|
11 |
# Setting up the logging
|
12 |
logging.basicConfig(level=logging.INFO)
|
13 |
logger = logging.getLogger(__name__)
|
|
|
14 |
retriever = SentenceTransformer(EMB_MODEL_NAME)
|
15 |
|
16 |
# db
|
|
|
3 |
import os
|
4 |
from pathlib import Path
|
5 |
from sentence_transformers import SentenceTransformer
|
6 |
+
from transformers import AutoModel
|
7 |
|
8 |
# EMB_MODEL_NAME = "sentence-transformers/all-MiniLM-L6-v2"
|
9 |
EMB_MODEL_NAME = "jinaai/jina-embeddings-v2-base-en"
|
|
|
12 |
# Setting up the logging
|
13 |
logging.basicConfig(level=logging.INFO)
|
14 |
logger = logging.getLogger(__name__)
|
15 |
+
model = AutoModel.from_pretrained(EMB_MODEL_NAME, trust_remote_code=True)
|
16 |
retriever = SentenceTransformer(EMB_MODEL_NAME)
|
17 |
|
18 |
# db
|