forked from stitionai/devika
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.py
29 lines (23 loc) · 971 Bytes
/
init.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import os
from src.config import Config
from src.logger import Logger
def init_devika():
config = Config()
logger = Logger()
logger.info("Initializing Devika...")
sqlite_db = config.get_sqlite_db()
screenshots_dir = config.get_screenshots_dir()
pdfs_dir = config.get_pdfs_dir()
projects_dir = config.get_projects_dir()
logs_dir = config.get_logs_dir()
logger.info("Initializing Prerequisites Jobs...")
os.makedirs(os.path.dirname(sqlite_db), exist_ok=True)
os.makedirs(screenshots_dir, exist_ok=True)
os.makedirs(pdfs_dir, exist_ok=True)
os.makedirs(projects_dir, exist_ok=True)
os.makedirs(logs_dir, exist_ok=True)
from src.bert.sentence import SentenceBert
logger.info("Loading sentence-transformer BERT models...")
prompt = "Light-weight keyword extraction exercise for BERT model loading.".strip()
SentenceBert(prompt).extract_keywords()
logger.info("BERT model loaded successfully.")