From 1c49da0c2da48c18ebc0ceb61dd2700a1cb84190 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Thu, 23 May 2024 11:43:38 +0200 Subject: [PATCH] Update launcher/src/main.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Daniƫl de Kok --- launcher/src/main.rs | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 6b861d7e..76bec963 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -35,23 +35,8 @@ struct Config { impl From for Config { fn from(other: RawConfig) -> Self { - if other.max_position_embeddings.is_some() { - Config { - max_position_embeddings: other.max_position_embeddings, - } - } else if other.max_seq_len.is_some() { - Config { - max_position_embeddings: other.max_seq_len, - } - } else if other.n_positions.is_some() { - Config { - max_position_embeddings: other.n_positions, - } - } else { - Config { - max_position_embeddings: None, - } - } + let max_position_embeddings = other.max_position_embeddings.or(other.max_seq_len).or(other.n_positions); + Config { max_position_embeddings } } }