mirror of
https://github.com/modelscope/modelscope.git
synced 2026-07-12 21:39:26 +02:00
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/11661608 * add command line tool * add unittest * change absolute import to relative import for test case * mv test_util to package
21 lines
404 B
Python
21 lines
404 B
Python
# Copyright (c) Alibaba, Inc. and its affiliates.
|
|
|
|
from abc import ABC, abstractmethod
|
|
from argparse import ArgumentParser
|
|
|
|
|
|
class CLICommand(ABC):
|
|
"""
|
|
Base class for command line tool.
|
|
|
|
"""
|
|
|
|
@staticmethod
|
|
@abstractmethod
|
|
def define_args(parsers: ArgumentParser):
|
|
raise NotImplementedError()
|
|
|
|
@abstractmethod
|
|
def execute(self):
|
|
raise NotImplementedError()
|