implement model config

This commit is contained in:
LUIS NOVO 2024-10-30 14:09:24 -03:00
parent 63a568490e
commit 8bb5db158f
19 changed files with 434 additions and 105 deletions

View file

@ -3,6 +3,10 @@ import os
import yaml
from loguru import logger
from open_notebook.domain.models import DefaultModels
from open_notebook.models.embedding_models import get_embedding_model
from open_notebook.models.speech_to_text_models import get_speech_to_text_model
# todo: enable config file overwrite with env vars
current_dir = os.path.dirname(os.path.abspath(__file__))
project_root = os.path.dirname(current_dir)
@ -32,3 +36,12 @@ os.makedirs(UPLOADS_FOLDER, exist_ok=True)
# PODCASTS FOLDER
PODCASTS_FOLDER = f"{DATA_FOLDER}/podcasts"
os.makedirs(PODCASTS_FOLDER, exist_ok=True)
DEFAULT_MODELS = DefaultModels.load()
EMBEDDING_MODEL = get_embedding_model(DEFAULT_MODELS.default_embedding_model)
SPEECH_TO_TEXT_MODEL = get_speech_to_text_model(
DEFAULT_MODELS.default_speech_to_text_model
)