refactor task

This commit is contained in:
Michael Poluektov 2024-08-10 12:50:09 +01:00
parent 60003c976a
commit 556141cdd8

View File

@ -1087,12 +1087,7 @@ async def generate_chat_completions(form_data: dict, user=Depends(get_verified_u
model = app.state.MODELS[model_id]
# `task` field is used to determine the type of the request, e.g. `title_generation`, `query_generation`, etc.
task = None
if "task" in form_data:
task = form_data["task"]
del form_data["task"]
if task:
if task := form_data.pop("task", None):
if "metadata" in form_data:
form_data["metadata"]["task"] = task
else: