-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstorage_init.py
32 lines (24 loc) · 1.1 KB
/
storage_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
30
31
32
import logging
import joblib
from dotenv import load_dotenv
load_dotenv()
from db import init_db
from kaggle_competition_assistant import KaggleCompetitionAssistant
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__file__)
competition_slugs = ['llm-zoomcamp-2024-competition', 'rohlik-orders-forecasting-challenge', 'arc-prize-2024']
def init_assistants():
assistants = {}
for competition_slug in competition_slugs:
assistants[competition_slug] = KaggleCompetitionAssistant(competition_slug,
competition_data_path=f'data/{competition_slug}',
index_type='opensearch')
return assistants
if __name__ == "__main__":
logger.info("Initializing database...")
init_db()
logger.info("Database initialized.")
logger.info("Initializing assistants...")
assistants = init_assistants()
joblib.dump(assistants, 'assistants.pkl')
logger.info("Assistants initialized.")