mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 04:14:52 +00:00
fix: show warning with tokenizer config parsing error
This commit is contained in:
parent
9c320e260b
commit
b2d7448a39
@ -462,7 +462,12 @@ pub async fn get_tokenizer_config(api_repo: &ApiRepo) -> Option<HubTokenizerConf
|
|||||||
let reader = BufReader::new(file);
|
let reader = BufReader::new(file);
|
||||||
|
|
||||||
// Read the JSON contents of the file as an instance of 'HubTokenizerConfig'.
|
// Read the JSON contents of the file as an instance of 'HubTokenizerConfig'.
|
||||||
let tokenizer_config: HubTokenizerConfig = serde_json::from_reader(reader).ok()?;
|
let tokenizer_config: HubTokenizerConfig = serde_json::from_reader(reader)
|
||||||
|
.map_err(|e| {
|
||||||
|
tracing::warn!("Unable to parse tokenizer config: {}", e);
|
||||||
|
e
|
||||||
|
})
|
||||||
|
.ok()?;
|
||||||
|
|
||||||
Some(tokenizer_config)
|
Some(tokenizer_config)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user