mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-30 07:39:38 +00:00
relative path
This commit is contained in:
parent
1fc00443a4
commit
1cec84ac38
1 changed files with 18 additions and 2 deletions
|
@ -16,8 +16,16 @@ import yaml
|
||||||
|
|
||||||
@lru_cache()
|
@lru_cache()
|
||||||
def available_templates_specs() -> List[BuildConfig]:
|
def available_templates_specs() -> List[BuildConfig]:
|
||||||
|
import os
|
||||||
|
|
||||||
|
TEMPLATES_PATH = (
|
||||||
|
Path(os.path.relpath(__file__)).parent.parent.parent
|
||||||
|
/ "distribution"
|
||||||
|
/ "templates"
|
||||||
|
)
|
||||||
|
|
||||||
template_specs = []
|
template_specs = []
|
||||||
for p in Path("llama_stack/distribution/templates/").rglob("*.yaml"):
|
for p in TEMPLATES_PATH.rglob("*.yaml"):
|
||||||
with open(p, "r") as f:
|
with open(p, "r") as f:
|
||||||
build_config = BuildConfig(**yaml.safe_load(f))
|
build_config = BuildConfig(**yaml.safe_load(f))
|
||||||
template_specs.append(build_config)
|
template_specs.append(build_config)
|
||||||
|
@ -157,7 +165,15 @@ class StackBuild(Subcommand):
|
||||||
self._run_template_list_cmd(args)
|
self._run_template_list_cmd(args)
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.config:
|
if args.template:
|
||||||
|
if not args.name:
|
||||||
|
self.parser.error(
|
||||||
|
"You must specify a name for the build using --name when using a template"
|
||||||
|
)
|
||||||
|
return
|
||||||
|
# build_path =
|
||||||
|
|
||||||
|
if not args.config and not args.template:
|
||||||
name = prompt(
|
name = prompt(
|
||||||
"> Enter a name for your Llama Stack, this name will be used as paths to store configuration files, build conda environments and docker images (e.g. my-local-stack): "
|
"> Enter a name for your Llama Stack, this name will be used as paths to store configuration files, build conda environments and docker images (e.g. my-local-stack): "
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue