satisfy compiler

This commit is contained in:
erikkaum 2024-07-18 18:04:00 +02:00
parent d0eef2b552
commit 6353e2417b
9 changed files with 22 additions and 0 deletions

View File

@ -143,6 +143,7 @@ impl Client {
seed: 0,
repetition_penalty: 1.2,
frequency_penalty: 0.1,
no_repeat_ngram_size: 0,
watermark: true,
grammar: String::new(),
grammar_type: GrammarType::None as i32,

View File

@ -228,6 +228,7 @@ impl Health for ShardedClient {
seed: 0,
repetition_penalty: 1.0,
frequency_penalty: 0.0,
no_repeat_ngram_size: 0,
watermark: false,
grammar: String::new(),
grammar_type: GrammarType::None as i32,

View File

@ -166,6 +166,7 @@ impl Client {
seed: 0,
repetition_penalty: 1.2,
frequency_penalty: 0.1,
no_repeat_ngram_size: 0,
watermark: true,
grammar: String::new(),
grammar_type: GrammarType::None as i32,

View File

@ -231,6 +231,7 @@ impl Health for ShardedClient {
seed: 0,
repetition_penalty: 1.0,
frequency_penalty: 0.0,
no_repeat_ngram_size: 0,
watermark: false,
grammar: String::new(),
grammar_type: GrammarType::None as i32,

View File

@ -454,6 +454,7 @@ impl From<ValidParameters> for NextTokenChooserParameters {
seed: value.seed,
repetition_penalty: value.repetition_penalty,
frequency_penalty: value.frequency_penalty,
no_repeat_ngram_size: value.no_repeat_ngram_size,
watermark: value.watermark,
grammar,
grammar_type: grammar_type.into(),
@ -497,6 +498,7 @@ mod tests {
seed: 0,
repetition_penalty: 0.0,
frequency_penalty: 0.0,
no_repeat_ngram_size: 0,
watermark: false,
grammar: None,
},

View File

@ -31,6 +31,7 @@ pub async fn run(
typical_p: Option<f32>,
repetition_penalty: Option<f32>,
frequency_penalty: Option<f32>,
no_repeat_ngram_size: Option<u32>,
watermark: bool,
do_sample: bool,
client: ShardedClient,
@ -44,6 +45,7 @@ pub async fn run(
seed: 0,
repetition_penalty: repetition_penalty.unwrap_or(1.0),
frequency_penalty: frequency_penalty.unwrap_or(0.0),
no_repeat_ngram_size: no_repeat_ngram_size.unwrap_or(0),
watermark,
grammar: String::new(),
grammar_type: GrammarType::None as i32,
@ -145,6 +147,7 @@ pub async fn run(
typical_p,
repetition_penalty,
frequency_penalty,
no_repeat_ngram_size,
watermark,
do_sample,
);

View File

@ -89,6 +89,11 @@ struct Args {
#[clap(long, env)]
frequency_penalty: Option<f32>,
/// Generation parameter in case you want to specifically test/debug particular
/// decoding strategies, for full doc refer to the `text-generation-server`
#[clap(long, env)]
no_repeat_ngram_size: Option<u32>,
/// Generation parameter in case you want to specifically test/debug particular
/// decoding strategies, for full doc refer to the `text-generation-server`
#[clap(long, env)]
@ -125,6 +130,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
typical_p,
repetition_penalty,
frequency_penalty,
no_repeat_ngram_size,
watermark,
do_sample,
master_shard_uds_path,
@ -196,6 +202,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
typical_p,
repetition_penalty,
frequency_penalty,
no_repeat_ngram_size,
watermark,
do_sample,
sharded_client,

View File

@ -377,6 +377,7 @@ impl From<ValidParameters> for NextTokenChooserParameters {
seed: value.seed,
repetition_penalty: value.repetition_penalty,
frequency_penalty: value.frequency_penalty,
no_repeat_ngram_size: value.no_repeat_ngram_size,
watermark: value.watermark,
grammar,
grammar_type: grammar_type.into(),
@ -420,6 +421,7 @@ mod tests {
seed: 0,
repetition_penalty: 0.0,
frequency_penalty: 0.0,
no_repeat_ngram_size: 0,
watermark: false,
grammar: None,
},

View File

@ -195,6 +195,7 @@ impl Validation {
temperature,
repetition_penalty,
frequency_penalty,
no_repeat_ngram_size,
top_k,
top_p,
typical_p,
@ -238,6 +239,8 @@ impl Validation {
return Err(ValidationError::FrequencyPenalty);
}
let no_repeat_ngram_size = no_repeat_ngram_size.unwrap_or(0);
// Different because the proto default value is not a valid value
// for the user
let top_p = top_p
@ -373,6 +376,7 @@ impl Validation {
temperature,
repetition_penalty,
frequency_penalty,
no_repeat_ngram_size,
top_k,
top_p,
typical_p,