mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 20:34:54 +00:00
Update launcher/src/main.rs
Co-authored-by: Daniël de Kok <me@github.danieldk.eu>
This commit is contained in:
parent
da1b5fa6b7
commit
1c49da0c2d
@ -35,23 +35,8 @@ struct Config {
|
|||||||
|
|
||||||
impl From<RawConfig> for Config {
|
impl From<RawConfig> for Config {
|
||||||
fn from(other: RawConfig) -> Self {
|
fn from(other: RawConfig) -> Self {
|
||||||
if other.max_position_embeddings.is_some() {
|
let max_position_embeddings = other.max_position_embeddings.or(other.max_seq_len).or(other.n_positions);
|
||||||
Config {
|
Config { max_position_embeddings }
|
||||||
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,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user