Don't allow changing model during generation

This commit is contained in:
vfbd 2022-08-29 13:23:19 -04:00
parent 807ddf6f26
commit 8292f17ab0
1 changed files with 5 additions and 0 deletions

View File

@ -7502,6 +7502,11 @@ def put_model(body: ModelSelectionSchema):
{api_validation_error_response}
{api_server_busy_response}
"""
if vars.aibusy or vars.genseqs:
abort(Response(json.dumps({"detail": {
"msg": "Server is busy; please try again later.",
"type": "service_unavailable",
}}), mimetype="application/json", status=503))
set_aibusy(1)
old_model = vars.model
vars.model = body.model.strip()