From 07638038fc9ca4f6675cc85615a5e09314278bf7 Mon Sep 17 00:00:00 2001 From: lisiur Date: Mon, 15 May 2023 14:07:52 +0800 Subject: [PATCH] fix(gui): fix chat config display error fix #49 --- service/src/api/openai/chat/params.rs | 8 ++++---- service/src/models/chat.rs | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/service/src/api/openai/chat/params.rs b/service/src/api/openai/chat/params.rs index 69daae4..d78f71a 100644 --- a/service/src/api/openai/chat/params.rs +++ b/service/src/api/openai/chat/params.rs @@ -16,7 +16,7 @@ pub struct OpenAIChatParams { /// /// We generally recommend altering this or top_p but not both. #[serde(skip_serializing_if = "Option::is_none")] - pub temperature: Option, + pub temperature: Option, /// An alternative to sampling with temperature, called nucleus sampling, /// where the model considers the results of the tokens with top_p probability mass. @@ -24,7 +24,7 @@ pub struct OpenAIChatParams { /// /// We generally recommend altering this or top_p but not both. #[serde(skip_serializing_if = "Option::is_none")] - pub top_p: Option, + pub top_p: Option, /// An alternative to sampling with temperature, called nucleus sampling, /// where the model considers the results of the tokens with top_p probability mass. @@ -53,13 +53,13 @@ pub struct OpenAIChatParams { /// Positive values penalize new tokens based on whether they appear in the text so far, /// increasing the model's likelihood to talk about new topics. #[serde(skip_serializing_if = "Option::is_none")] - pub presence_penalty: Option, + pub presence_penalty: Option, /// Number between -2.0 and 2.0. /// Positive values penalize new tokens based on their existing frequency in the text so far, /// decreasing the model's likelihood to repeat the same line verbatim. #[serde(skip_serializing_if = "Option::is_none")] - pub frequency_penalty: Option, + pub frequency_penalty: Option, /// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/service/src/models/chat.rs b/service/src/models/chat.rs index f961c07..11643ef 100644 --- a/service/src/models/chat.rs +++ b/service/src/models/chat.rs @@ -94,16 +94,16 @@ pub struct ChatParams { pub model: String, #[serde(skip_serializing_if = "Option::is_none")] - pub temperature: Option, + pub temperature: Option, #[serde(skip_serializing_if = "Option::is_none")] pub stop: Option>, #[serde(skip_serializing_if = "Option::is_none")] - pub presence_penalty: Option, + pub presence_penalty: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub frequency_penalty: Option, + pub frequency_penalty: Option, } impl Default for ChatParams {