mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 17:35:07 +01:00
Use embeddings model store from state in text to entries
Do not need to instantiating it separately. In all other places we're using the embeddings model store in global state anyway
This commit is contained in:
parent
f88a5867b4
commit
0679b2a7bd
1 changed files with 3 additions and 4 deletions
|
@ -6,15 +6,15 @@ import logging
|
|||
import uuid
|
||||
from tqdm import tqdm
|
||||
from typing import Callable, List, Tuple, Set, Any
|
||||
from khoj.utils import state
|
||||
from khoj.utils.helpers import is_none_or_empty, timer, batcher
|
||||
|
||||
|
||||
# Internal Packages
|
||||
from khoj.utils.rawconfig import Entry
|
||||
from khoj.processor.embeddings import EmbeddingsModel
|
||||
from khoj.search_filter.date_filter import DateFilter
|
||||
from database.models import KhojUser, Entry as DbEntry, EntryDates
|
||||
from database.adapters import EntryAdapters, get_or_create_search_model
|
||||
from database.adapters import EntryAdapters
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -22,8 +22,7 @@ logger = logging.getLogger(__name__)
|
|||
|
||||
class TextToEntries(ABC):
|
||||
def __init__(self, config: Any = None):
|
||||
bi_encoder_name = get_or_create_search_model().bi_encoder
|
||||
self.embeddings_model = EmbeddingsModel(bi_encoder_name)
|
||||
self.embeddings_model = state.embeddings_model
|
||||
self.config = config
|
||||
self.date_filter = DateFilter()
|
||||
|
||||
|
|
Loading…
Reference in a new issue