feat: support do_sample param in ChatRequest

This commit is contained in:
drbh 2024-04-15 17:06:53 +00:00
parent 06c3d4b1ec
commit 0520bde039
2 changed files with 5 additions and 1 deletions

View File

@ -709,6 +709,10 @@ pub(crate) struct ChatRequest {
#[schema(nullable = true, example = "null")]
#[serde(deserialize_with = "deserialize_tool_choice::deserialize")]
pub tool_choice: Option<ToolType>,
#[serde(default)]
#[schema(default = "false", example = true)]
pub do_sample: bool,
}
fn default_tool_prompt() -> Option<String> {

View File

@ -1060,7 +1060,7 @@ async fn chat_completions(
top_k: None,
top_p: req.top_p,
typical_p: None,
do_sample: true,
do_sample: req.do_sample,
max_new_tokens,
return_full_text: None,
stop,