feat: allow null eos and bos tokens in config

This commit is contained in:
drbh 2024-04-22 13:58:46 -04:00
parent ed72e92126
commit 87c4828c4e
2 changed files with 5 additions and 1 deletions

View File

@ -116,6 +116,7 @@ mod token_serde {
)) ))
} }
} }
Value::Null => Ok(None),
_ => Err(de::Error::custom("invalid token format")), _ => Err(de::Error::custom("invalid token format")),
} }
} }

View File

@ -254,7 +254,10 @@ async fn main() -> Result<(), RouterError> {
// Load tokenizer config if found locally, or check if we can get it from the API if needed // Load tokenizer config if found locally, or check if we can get it from the API if needed
let tokenizer_config = if let Some(path) = tokenizer_config_path { let tokenizer_config = if let Some(path) = tokenizer_config_path {
tracing::info!("Using local tokenizer config from user specified path"); tracing::info!(
"Using local tokenizer config from user specified path {}",
path
);
HubTokenizerConfig::from_file(&std::path::PathBuf::from(path)) HubTokenizerConfig::from_file(&std::path::PathBuf::from(path))
} else if local_model { } else if local_model {
tracing::info!("Using local tokenizer config"); tracing::info!("Using local tokenizer config");