Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PREDIBASE_API_TOKEN env var being thrown away #654

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions launcher/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,6 @@ fn shard_manager(
fs::remove_file(uds).unwrap();
}

// Copy current process env
let mut envs: Vec<(OsString, OsString)> = env::vars_os().collect();

// Process args
let mut shard_args = vec![
"serve".to_string(),
Expand Down Expand Up @@ -588,13 +585,6 @@ fn shard_manager(
shard_args.push(preloaded_adapter_source);
}

if let Some(predibase_api_token) = predibase_api_token {
envs.push((
"PREDIBASE_API_TOKEN".into(),
predibase_api_token.to_string().into(),
));
}

if let Some(dtype) = dtype {
shard_args.push("--dtype".to_string());
shard_args.push(dtype.to_string())
Expand All @@ -621,6 +611,13 @@ fn shard_manager(
// Copy current process env
let mut envs: Vec<(OsString, OsString)> = env::vars_os().collect();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line was introduced in #621 , which means that the value of envs is overwritten and no longer contains the value of PREDIBASE_API_TOKEN.


if let Some(predibase_api_token) = predibase_api_token {
envs.push((
"PREDIBASE_API_TOKEN".into(),
predibase_api_token.to_string().into(),
));
}

// Torch Distributed Env vars
envs.push(("RANK".into(), rank.to_string().into()));
envs.push(("WORLD_SIZE".into(), world_size.to_string().into()));
Expand Down
Loading