forked from phoenix-oss/llama-stack-mirror
[CLI] remove dependency on CONDA_PREFIX in CLI (#144)
* remove dependency on CONDA_PREFIX in CLI * lint * typo * more robust
This commit is contained in:
parent
fe460ba103
commit
6a8c2ae1df
4 changed files with 26 additions and 20 deletions
|
@ -65,18 +65,27 @@ class StackConfigure(Subcommand):
|
|||
f"Could not find {build_config_file}. Trying conda build name instead...",
|
||||
color="green",
|
||||
)
|
||||
if os.getenv("CONDA_PREFIX"):
|
||||
if os.getenv("CONDA_PREFIX", ""):
|
||||
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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue