Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
text-generation-inference
Commits
e63a21eb
Unverified
Commit
e63a21eb
authored
Apr 09, 2023
by
OlivierDehaene
Committed by
GitHub
Apr 09, 2023
Browse files
feat(launcher): allow disabling hf_transfer (#161)
parent
1883d8ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
launcher/src/main.rs
launcher/src/main.rs
+20
-2
No files found.
launcher/src/main.rs
View file @
e63a21eb
...
@@ -200,7 +200,16 @@ fn main() -> ExitCode {
...
@@ -200,7 +200,16 @@ fn main() -> ExitCode {
};
};
// Enable hf transfer for insane download speeds
// Enable hf transfer for insane download speeds
env
.push
((
"HF_HUB_ENABLE_HF_TRANSFER"
.into
(),
"1"
.into
()));
let
enable_hf_transfer
=
env
::
var
(
"HF_HUB_ENABLE_HF_TRANSFER"
)
.unwrap_or
(
"1"
.to_string
());
env
.push
((
"HF_HUB_ENABLE_HF_TRANSFER"
.into
(),
enable_hf_transfer
.into
(),
));
// Parse Inference API token
if
let
Ok
(
api_token
)
=
env
::
var
(
"HF_API_TOKEN"
)
{
env
.push
((
"HUGGING_FACE_HUB_TOKEN"
.into
(),
api_token
.into
()))
};
// Start process
// Start process
tracing
::
info!
(
"Starting download process."
);
tracing
::
info!
(
"Starting download process."
);
...
@@ -555,7 +564,16 @@ fn shard_manager(
...
@@ -555,7 +564,16 @@ fn shard_manager(
env
.push
((
"SAFETENSORS_FAST_GPU"
.into
(),
"1"
.into
()));
env
.push
((
"SAFETENSORS_FAST_GPU"
.into
(),
"1"
.into
()));
// Enable hf transfer for insane download speeds
// Enable hf transfer for insane download speeds
env
.push
((
"HF_HUB_ENABLE_HF_TRANSFER"
.into
(),
"1"
.into
()));
let
enable_hf_transfer
=
env
::
var
(
"HF_HUB_ENABLE_HF_TRANSFER"
)
.unwrap_or
(
"1"
.to_string
());
env
.push
((
"HF_HUB_ENABLE_HF_TRANSFER"
.into
(),
enable_hf_transfer
.into
(),
));
// Parse Inference API token
if
let
Ok
(
api_token
)
=
env
::
var
(
"HF_API_TOKEN"
)
{
env
.push
((
"HUGGING_FACE_HUB_TOKEN"
.into
(),
api_token
.into
()))
};
// If huggingface_hub_cache is some, pass it to the shard
// If huggingface_hub_cache is some, pass it to the shard
// Useful when running inside a docker container
// Useful when running inside a docker container
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment