This commit is contained in:
Timothy Jaeryang Baek
2025-02-12 23:26:47 -08:00
parent 2b7f9d14d0
commit 83e5db7be7
4 changed files with 16 additions and 11 deletions

View File

@@ -165,7 +165,7 @@ async def generate_chat_completion(
if BYPASS_MODEL_ACCESS_CONTROL:
bypass_filter = True
if request.state.direct and request.state.model:
if getattr(request.state, "direct", False) and hasattr(request.state, "model"):
models = {
request.state.model["id"]: request.state.model,
}
@@ -284,7 +284,7 @@ async def chat_completed(request: Request, form_data: dict, user: Any):
if not request.app.state.MODELS:
await get_all_models(request)
if request.state.direct and request.state.model:
if getattr(request.state, "direct", False) and hasattr(request.state, "model"):
models = {
request.state.model["id"]: request.state.model,
}
@@ -350,7 +350,7 @@ async def chat_action(request: Request, action_id: str, form_data: dict, user: A
if not request.app.state.MODELS:
await get_all_models(request)
if request.state.direct and request.state.model:
if getattr(request.state, "direct", False) and hasattr(request.state, "model"):
models = {
request.state.model["id"]: request.state.model,
}