mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 04:14:52 +00:00
fix: avoid program exit on repo fetch failures
This commit is contained in:
parent
fb6c220dc8
commit
4a47f66da1
@ -176,7 +176,13 @@ async fn main() -> Result<(), RouterError> {
|
||||
// Initialize API if needed
|
||||
let api = if use_api {
|
||||
tracing::info!("Using the Hugging Face API");
|
||||
Some(api_builder().build().unwrap())
|
||||
match api_builder().build() {
|
||||
Ok(api) => Some(api),
|
||||
Err(_) => {
|
||||
tracing::warn!("Unable to build the Hugging Face API");
|
||||
None
|
||||
}
|
||||
}
|
||||
} else {
|
||||
None
|
||||
};
|
||||
@ -232,7 +238,10 @@ async fn main() -> Result<(), RouterError> {
|
||||
revision.unwrap_or_else(|| "main".to_string()),
|
||||
)))
|
||||
.await
|
||||
.unwrap()
|
||||
.unwrap_or_else(|| {
|
||||
tracing::warn!("Could not retrieve tokenizer config from the Hugging Face hub.");
|
||||
HubTokenizerConfig::default()
|
||||
})
|
||||
} else {
|
||||
tracing::warn!("Could not find tokenizer config locally and no revision specified");
|
||||
HubTokenizerConfig::default()
|
||||
|
Loading…
Reference in New Issue
Block a user