mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-27 18:50:41 +00:00
# What does this PR do? - Configured ruff linter to automatically fix import sorting issues. - Set --exit-non-zero-on-fix to ensure non-zero exit code when fixes are applied. - Enabled the 'I' selection to focus on import-related linting rules. - Ran the linter, and formatted all codebase imports accordingly. - Removed the black dep from the "dev" group since we use ruff Signed-off-by: Sébastien Han <seb@redhat.com> [//]: # (If resolving an issue, uncomment and update the line below) [//]: # (Closes #[issue-number]) ## Test Plan [Describe the tests you ran to verify your changes with result summaries. *Provide clear instructions so the plan can be easily re-executed.*] [//]: # (## Documentation) [//]: # (- [ ] Added a Changelog entry if the change is significant) Signed-off-by: Sébastien Han <seb@redhat.com>
37 lines
1.3 KiB
Python
37 lines
1.3 KiB
Python
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
# All rights reserved.
|
|
#
|
|
# This source code is licensed under the terms described in the LICENSE file in
|
|
# the root directory of this source tree.
|
|
|
|
import argparse
|
|
|
|
from llama_stack.cli.model.describe import ModelDescribe
|
|
from llama_stack.cli.model.download import ModelDownload
|
|
from llama_stack.cli.model.list import ModelList
|
|
from llama_stack.cli.model.prompt_format import ModelPromptFormat
|
|
from llama_stack.cli.model.verify_download import ModelVerifyDownload
|
|
from llama_stack.cli.subcommand import Subcommand
|
|
|
|
|
|
class ModelParser(Subcommand):
|
|
"""Llama cli for model interface apis"""
|
|
|
|
def __init__(self, subparsers: argparse._SubParsersAction):
|
|
super().__init__()
|
|
self.parser = subparsers.add_parser(
|
|
"model",
|
|
prog="llama model",
|
|
description="Work with llama models",
|
|
)
|
|
|
|
self.parser.set_defaults(func=lambda args: self.parser.print_help())
|
|
|
|
subparsers = self.parser.add_subparsers(title="model_subcommands")
|
|
|
|
# Add sub-commands
|
|
ModelDownload.create(subparsers)
|
|
ModelList.create(subparsers)
|
|
ModelPromptFormat.create(subparsers)
|
|
ModelDescribe.create(subparsers)
|
|
ModelVerifyDownload.create(subparsers)
|