mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-12 04:44:52 +00:00
Backporting 457fb0a1
This commit is contained in:
parent
bbdd26e2be
commit
9357fc162a
@ -1553,7 +1553,10 @@ pub async fn run(
|
|||||||
}
|
}
|
||||||
let api = if use_api {
|
let api = if use_api {
|
||||||
if std::env::var("HF_HUB_OFFLINE") == Ok("1".to_string()) {
|
if std::env::var("HF_HUB_OFFLINE") == Ok("1".to_string()) {
|
||||||
let cache = Cache::default();
|
let cache = std::env::var("HUGGINGFACE_HUB_CACHE")
|
||||||
|
.map_err(|_| ())
|
||||||
|
.map(|cache_dir| Cache::new(cache_dir.into()))
|
||||||
|
.unwrap_or_else(|_| Cache::default());
|
||||||
tracing::warn!("Offline mode active using cache defaults");
|
tracing::warn!("Offline mode active using cache defaults");
|
||||||
Type::Cache(cache)
|
Type::Cache(cache)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user