Expose no_stop_trim and skip_special_tokens in openai api (#2039)

This commit is contained in:
Lianmin Zheng
2024-11-14 19:09:21 -08:00
committed by GitHub
parent a10d530943
commit ea53c63bad
3 changed files with 35 additions and 29 deletions

View File

@@ -516,8 +516,9 @@ def v1_generate_request(
"regex": request.regex,
"json_schema": request.json_schema,
"n": request.n,
"ignore_eos": request.ignore_eos,
"no_stop_trim": request.no_stop_trim,
"ignore_eos": request.ignore_eos,
"skip_special_tokens": request.skip_special_tokens,
}
)
return_logprobs.append(request.logprobs is not None and request.logprobs > 0)
@@ -928,7 +929,9 @@ def v1_chat_generate_request(
"repetition_penalty": request.repetition_penalty,
"regex": request.regex,
"n": request.n,
"no_stop_trim": request.no_stop_trim,
"ignore_eos": request.ignore_eos,
"skip_special_tokens": request.skip_special_tokens,
}
if request.response_format and request.response_format.type == "json_schema":
sampling_params["json_schema"] = convert_json_schema_to_str(