mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-08-15 12:05:19 +08:00
add new debug option 'DEBUG_DATABASE_ECHO' (default False)
This commit is contained in:
@@ -79,6 +79,7 @@ class Settings(BaseSettings):
|
|||||||
DEBUG_ALLOW_SELF_LABELING: bool = False # allow users to label their own messages
|
DEBUG_ALLOW_SELF_LABELING: bool = False # allow users to label their own messages
|
||||||
DEBUG_SKIP_EMBEDDING_COMPUTATION: bool = False
|
DEBUG_SKIP_EMBEDDING_COMPUTATION: bool = False
|
||||||
DEBUG_SKIP_TOXICITY_CALCULATION: bool = False
|
DEBUG_SKIP_TOXICITY_CALCULATION: bool = False
|
||||||
|
DEBUG_DATABASE_ECHO: bool = False
|
||||||
|
|
||||||
HUGGING_FACE_API_KEY: str = ""
|
HUGGING_FACE_API_KEY: str = ""
|
||||||
|
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ from sqlmodel import create_engine
|
|||||||
if settings.DATABASE_URI is None:
|
if settings.DATABASE_URI is None:
|
||||||
raise OasstError("DATABASE_URI is not set", error_code=OasstErrorCode.DATABASE_URI_NOT_SET)
|
raise OasstError("DATABASE_URI is not set", error_code=OasstErrorCode.DATABASE_URI_NOT_SET)
|
||||||
|
|
||||||
engine = create_engine(settings.DATABASE_URI, echo=True, isolation_level="REPEATABLE READ")
|
engine = create_engine(settings.DATABASE_URI, echo=settings.DEBUG_DATABASE_ECHO, isolation_level="REPEATABLE READ")
|
||||||
|
|||||||
Reference in New Issue
Block a user