mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 12:07:34 +00:00
fix run-config/config-file to config
This commit is contained in:
parent
ace3953926
commit
6c97e84372
4 changed files with 14 additions and 16 deletions
|
@ -85,7 +85,7 @@ class StackBuild(Subcommand):
|
|||
choices=[v.value for v in BuildType],
|
||||
)
|
||||
self.parser.add_argument(
|
||||
"--config-file",
|
||||
"--config",
|
||||
type=str,
|
||||
help="Path to a config file to use for the build",
|
||||
)
|
||||
|
@ -170,14 +170,12 @@ class StackBuild(Subcommand):
|
|||
)
|
||||
|
||||
def _run_stack_build_command(self, args: argparse.Namespace) -> None:
|
||||
if args.config_file:
|
||||
with open(args.config_file, "r") as f:
|
||||
if args.config:
|
||||
with open(args.config, "r") as f:
|
||||
try:
|
||||
build_config = BuildConfig(**yaml.safe_load(f))
|
||||
except Exception as e:
|
||||
self.parser.error(
|
||||
f"Could not parse config file {args.config_file}: {e}"
|
||||
)
|
||||
self.parser.error(f"Could not parse config file {args.config}: {e}")
|
||||
return
|
||||
self._run_stack_build_command_from_build_config(build_config)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue