Skip to content

Commit

Permalink
fix(gui): fix chat config display error
Browse files Browse the repository at this point in the history
  • Loading branch information
lisiur committed May 15, 2023
1 parent 197861b commit 0763803
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions service/src/api/openai/chat/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ pub struct OpenAIChatParams {
///
/// We generally recommend altering this or top_p but not both.
#[serde(skip_serializing_if = "Option::is_none")]
pub temperature: Option<f32>,
pub temperature: Option<f64>,

/// An alternative to sampling with temperature, called nucleus sampling,
/// where the model considers the results of the tokens with top_p probability mass.
/// So 0.1 means only the tokens comprising the top 10% probability mass are considered.
///
/// We generally recommend altering this or top_p but not both.
#[serde(skip_serializing_if = "Option::is_none")]
pub top_p: Option<f32>,
pub top_p: Option<f64>,

/// An alternative to sampling with temperature, called nucleus sampling,
/// where the model considers the results of the tokens with top_p probability mass.
Expand Down Expand Up @@ -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<f32>,
pub presence_penalty: Option<f64>,

/// 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<f32>,
pub frequency_penalty: Option<f64>,

/// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
6 changes: 3 additions & 3 deletions service/src/models/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ pub struct ChatParams {
pub model: String,

#[serde(skip_serializing_if = "Option::is_none")]
pub temperature: Option<f32>,
pub temperature: Option<f64>,

#[serde(skip_serializing_if = "Option::is_none")]
pub stop: Option<Vec<String>>,

#[serde(skip_serializing_if = "Option::is_none")]
pub presence_penalty: Option<f32>,
pub presence_penalty: Option<f64>,

#[serde(skip_serializing_if = "Option::is_none")]
pub frequency_penalty: Option<f32>,
pub frequency_penalty: Option<f64>,
}

impl Default for ChatParams {
Expand Down

0 comments on commit 0763803

Please sign in to comment.