temporary fix to config cache

This commit is contained in:
LUIS NOVO 2024-11-01 17:06:10 -03:00
parent cc9b0ac68c
commit b89250d3ca
18 changed files with 664 additions and 587 deletions

View file

@ -36,18 +36,20 @@ PODCASTS_FOLDER = f"{DATA_FOLDER}/podcasts"
os.makedirs(PODCASTS_FOLDER, exist_ok=True)
DEFAULT_MODELS = DefaultModels.load()
if DEFAULT_MODELS.default_embedding_model:
EMBEDDING_MODEL = get_model(
DEFAULT_MODELS.default_embedding_model, model_type="embedding"
def load_default_models():
default_models = DefaultModels.load()
embedding_model = (
get_model(default_models.default_embedding_model, model_type="embedding")
if default_models.default_embedding_model
else None
)
else:
EMBEDDING_MODEL = None
if DEFAULT_MODELS.default_speech_to_text_model:
SPEECH_TO_TEXT_MODEL = get_model(
DEFAULT_MODELS.default_speech_to_text_model, model_type="speech_to_text"
speech_to_text_model = (
get_model(
default_models.default_speech_to_text_model, model_type="speech_to_text"
)
if default_models.default_speech_to_text_model
else None
)
else:
SPEECH_TO_TEXT_MODEL = None
return default_models, embedding_model, speech_to_text_model