mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-17 06:45:01 +08:00
Signed-off-by: Yeshwanth Surya <yeshsurya@gmail.com> Signed-off-by: Yeshwanth N <yeshsurya@gmail.com> Signed-off-by: yeshsurya <yeshsurya@gmail.com>
39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
# SPDX-License-Identifier: Apache-2.0
|
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
|
|
import argparse
|
|
import typing
|
|
|
|
from vllm.collect_env import main as collect_env_main
|
|
from vllm.entrypoints.cli.types import CLISubcommand
|
|
|
|
if typing.TYPE_CHECKING:
|
|
from vllm.utils.argparse_utils import FlexibleArgumentParser
|
|
else:
|
|
FlexibleArgumentParser = argparse.ArgumentParser
|
|
|
|
|
|
class CollectEnvSubcommand(CLISubcommand):
|
|
"""The `collect-env` subcommand for the vLLM CLI."""
|
|
|
|
name = "collect-env"
|
|
|
|
@staticmethod
|
|
def cmd(args: argparse.Namespace) -> None:
|
|
"""Collect information about the environment."""
|
|
collect_env_main()
|
|
|
|
def subparser_init(
|
|
self, subparsers: argparse._SubParsersAction
|
|
) -> FlexibleArgumentParser:
|
|
return subparsers.add_parser(
|
|
"collect-env",
|
|
help="Start collecting environment information.",
|
|
description="Start collecting environment information.",
|
|
usage="vllm collect-env",
|
|
)
|
|
|
|
|
|
def cmd_init() -> list[CLISubcommand]:
|
|
return [CollectEnvSubcommand()]
|