From 89b675c267aa3de70be330b4969f4d858a0e6919 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Sun, 30 Oct 2022 19:24:43 +0200 Subject: [PATCH] Fix clearml-init colab detection --- clearml/cli/config/__main__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clearml/cli/config/__main__.py b/clearml/cli/config/__main__.py index d5fdaf1d..7fc9e429 100644 --- a/clearml/cli/config/__main__.py +++ b/clearml/cli/config/__main__.py @@ -67,8 +67,8 @@ def main(): print(description, end='') sentinel = '' parse_input = '' - # COLAB_GPU will always be available, even when running on CPU - if os.environ.get('COLAB_GPU'): + + if os.environ.get("JPY_PARENT_PID"): # When running from a colab instance and calling clearml-init # colab will squish the api credentials into a single line # The regex splits this single line based on 2 spaces or more @@ -80,6 +80,7 @@ def main(): parse_input += line+'\n' if line.rstrip() == '}': break + credentials = None api_server = None web_server = None