Fixes to llama stack commands and update docs

This commit is contained in:
Ashwin Bharambe 2024-09-02 18:58:54 -07:00
parent 5927f3c3c0
commit 279565499b
4 changed files with 22 additions and 21 deletions

View file

@ -6,7 +6,6 @@
import argparse
from .api import ApiParser
from .download import Download
from .model import ModelParser
from .stack import StackParser
@ -31,7 +30,6 @@ class LlamaCLIParser:
Download.create(subparsers)
ModelParser.create(subparsers)
StackParser.create(subparsers)
ApiParser.create(subparsers)
# Import sub-commands from agentic_system if they exist
try:

View file

@ -44,13 +44,13 @@ class StackConfigure(Subcommand):
help="Distribution (one of: {})".format(allowed_ids),
)
self.parser.add_argument(
"--build-name",
"--name",
type=str,
help="Name of the build",
required=True,
)
self.parser.add_argument(
"--build-type",
"--type",
type=str,
default="conda_env",
choices=[v.value for v in BuildType],
@ -59,8 +59,8 @@ class StackConfigure(Subcommand):
def _run_stack_configure_cmd(self, args: argparse.Namespace) -> None:
from llama_toolchain.core.package import BuildType
build_type = BuildType(args.build_type)
name = args.build_name
build_type = BuildType(args.type)
name = args.name
config_file = (
BUILDS_BASE_DIR
/ args.distribution

View file

@ -37,12 +37,13 @@ class StackStart(Subcommand):
help="Distribution whose build you want to start",
)
self.parser.add_argument(
"--build-name",
"--name",
type=str,
help="Name of the API build you want to start",
required=True,
)
self.parser.add_argument(
"--build-type",
"--type",
type=str,
default="conda_env",
choices=[v.value for v in BuildType],
@ -64,12 +65,12 @@ class StackStart(Subcommand):
from llama_toolchain.common.exec import run_with_pty
from llama_toolchain.core.package import BuildType
if args.build_name.endswith(".yaml"):
path = args.build_name
if args.name.endswith(".yaml"):
path = args.name
else:
build_type = BuildType(args.build_type)
build_type = BuildType(args.type)
build_dir = BUILDS_BASE_DIR / args.distribution / build_type.descriptor()
path = build_dir / f"{args.build_name}.yaml"
path = build_dir / f"{args.name}.yaml"
config_file = Path(path)