mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-04-19 22:02:06 +00:00
Only add token when it is defined. (#3073)
* Only add token when it is defined. * Update router/src/server.rs
This commit is contained in:
parent
cb42b3ad83
commit
ec35976f82
@ -1711,9 +1711,10 @@ pub async fn run(
|
|||||||
|
|
||||||
// Shared API builder initialization
|
// Shared API builder initialization
|
||||||
let api_builder = || {
|
let api_builder = || {
|
||||||
let mut builder = ApiBuilder::new()
|
let mut builder = ApiBuilder::new().with_progress(false);
|
||||||
.with_progress(false)
|
if let Some(token) = authorization_token {
|
||||||
.with_token(authorization_token);
|
builder = builder.with_token(Some(token));
|
||||||
|
}
|
||||||
|
|
||||||
if let Ok(cache_dir) = std::env::var("HUGGINGFACE_HUB_CACHE") {
|
if let Ok(cache_dir) = std::env::var("HUGGINGFACE_HUB_CACHE") {
|
||||||
builder = builder.with_cache_dir(cache_dir.into());
|
builder = builder.with_cache_dir(cache_dir.into());
|
||||||
|
Loading…
Reference in New Issue
Block a user