fix: undefined model_id issue
This commit is contained in:
@@ -1375,13 +1375,13 @@ async def chat_completion(
|
|||||||
if not request.app.state.MODELS:
|
if not request.app.state.MODELS:
|
||||||
await get_all_models(request, user=user)
|
await get_all_models(request, user=user)
|
||||||
|
|
||||||
|
model_id = form_data.get("model", None)
|
||||||
model_item = form_data.pop("model_item", {})
|
model_item = form_data.pop("model_item", {})
|
||||||
tasks = form_data.pop("background_tasks", None)
|
tasks = form_data.pop("background_tasks", None)
|
||||||
|
|
||||||
metadata = {}
|
metadata = {}
|
||||||
try:
|
try:
|
||||||
if not model_item.get("direct", False):
|
if not model_item.get("direct", False):
|
||||||
model_id = form_data.get("model", None)
|
|
||||||
if model_id not in request.app.state.MODELS:
|
if model_id not in request.app.state.MODELS:
|
||||||
raise Exception("Model not found")
|
raise Exception("Model not found")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user