extensions/openai: load extension settings via settings.yaml (#3953)

This commit is contained in:
Chenxiao Wang 2023-09-18 09:39:29 +08:00 committed by GitHub
parent cc8eda298a
commit 347aed4254
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 48 additions and 16 deletions

View file

@ -6,6 +6,7 @@
import os
import sentence_transformers
from extensions.openai.script import params
st_model = os.environ["OPENEDAI_EMBEDDING_MODEL"] if "OPENEDAI_EMBEDDING_MODEL" in os.environ else "all-mpnet-base-v2"
st_model = os.environ.get("OPENEDAI_EMBEDDING_MODEL", params.get('embedding_model', 'all-mpnet-base-v2'))
model = sentence_transformers.SentenceTransformer(st_model)