From 0477b29ba9233098b58ed5c96c0b556f99a41938 Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Sat, 28 Sep 2024 16:32:29 -0700 Subject: [PATCH] lint --- llama_stack/cli/stack/configure.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/llama_stack/cli/stack/configure.py b/llama_stack/cli/stack/configure.py index 5b1fbba86..a08d02cf2 100644 --- a/llama_stack/cli/stack/configure.py +++ b/llama_stack/cli/stack/configure.py @@ -69,14 +69,23 @@ class StackConfigure(Subcommand): conda_dir = ( Path(os.getenv("CONDA_PREFIX")).parent / f"llamastack-{args.config}" ) - build_config_file = Path(conda_dir) / f"{args.config}-build.yaml" + else: + cprint( + "Cannot find CONDA_PREFIX. Trying default conda path ~/.conda/envs...", + color="green", + ) + conda_dir = ( + Path(os.path.expanduser("~/.conda/envs")) / f"llamastack-{args.config}" + ) - if build_config_file.exists(): - with open(build_config_file, "r") as f: - build_config = BuildConfig(**yaml.safe_load(f)) + build_config_file = Path(conda_dir) / f"{args.config}-build.yaml" - self._configure_llama_distribution(build_config, args.output_dir) - return + if build_config_file.exists(): + with open(build_config_file, "r") as f: + build_config = BuildConfig(**yaml.safe_load(f)) + + self._configure_llama_distribution(build_config, args.output_dir) + return # if we get here, we need to try to find the docker image cprint(