[Tune] Wandb API Key File Compatibility with Ray Client (#14942)

This commit is contained in:
Amog Kamsetty 2021-03-29 06:39:54 -07:00 committed by GitHub
parent 68c82b6503
commit 95ff342558
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"):