diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 27ac09800..c181d898e 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -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(), @@ -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()) @@ -621,6 +611,13 @@ fn shard_manager( // Copy current process env let mut envs: Vec<(OsString, OsString)> = env::vars_os().collect(); + 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()));