From 95ff342558e23cdd776ff87a592edb21b46c7906 Mon Sep 17 00:00:00 2001 From: Amog Kamsetty Date: Mon, 29 Mar 2021 06:39:54 -0700 Subject: [PATCH] [Tune] Wandb API Key File Compatibility with Ray Client (#14942) --- python/ray/tune/integration/wandb.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/ray/tune/integration/wandb.py b/python/ray/tune/integration/wandb.py index fb8b2a69f..98e79cedb 100644 --- a/python/ray/tune/integration/wandb.py +++ b/python/ray/tune/integration/wandb.py @@ -299,8 +299,7 @@ class WandbLoggerCallback(LoggerCallback): **kwargs): self.project = project self.group = group - self.api_key_file = os.path.expanduser( - api_key_file) if api_key_file else None + self.api_key_path = api_key_file self.api_key = api_key self.excludes = excludes or [] self.log_config = log_config @@ -310,6 +309,8 @@ class WandbLoggerCallback(LoggerCallback): self._trial_queues: Dict["Trial", Queue] = {} def setup(self): + self.api_key_file = os.path.expanduser(self.api_key_path) if \ + self.api_key_path else None _set_api_key(self.api_key_file, self.api_key) def log_trial_start(self, trial: "Trial"):