Beispiel #1
0
def models(name, framework, engine, version, list_all, quiet):
    payload = remove_dict_null({
        'name': name,
        'framework': framework,
        'engine': engine,
        'version': version
    })
    with requests.get(f'http://{SERVER_HOST}:{SERVER_PORT}/api/v1/model/',
                      params=payload) as r:
        model_list = r.json()
        model_view([model_list], list_all=list_all, quiet=quiet)
Beispiel #2
0
def show_models(name, framework, engine, version, list_all):
    """show a table that lists all models published in mlmodelci

    Args:
        name ([type]): [description]
        framework ([type]): [description]
        engine ([type]): [description]
        version ([type]): [description]
        list_all ([type]): [description]
    """
    payload = remove_dict_null({
        'name': name,
        'framework': framework,
        'engine': engine,
        'version': version
    })
    with requests.get(f'http://{SERVER_HOST}:{SERVER_PORT}/api/v1/model/',
                      params=payload) as r:
        model_list = r.json()
        model_view([model_list], list_all=list_all)
Beispiel #3
0
def list_models(
        architecture: Optional[str] = typer.Option(None, '-n', '--name', help='Model architecture name'),
        framework: Optional[Framework] = typer.Option(None, '-fw', '--framework', case_sensitive=False,
                                                      help='Framework'),
        engine: Optional[Engine] = typer.Option(None, '-e', '--engine', case_sensitive=False, help='Serving engine'),
        version: Optional[int] = typer.Option(None, '-v', '--version', help='Version'),
        list_all: Optional[bool] = typer.Option(
            False,
            '-a', '--all', is_flag=True,
            help='Display queried models. otherwise, only partial result will be shown.'
        ),
):
    """Show a table that lists all models published in MLModelCI"""

    payload = remove_dict_null(
        {'architecture': architecture, 'framework': framework, 'engine': engine, 'version': version}
    )
    with requests.get(f'{app_settings.api_v1_prefix}/model', params=payload) as r:
        model_list = r.json()
        model_view([MLModel.parse_obj(model) for model in model_list], list_all=list_all)
Beispiel #4
0
def models(name, framework, engine, version, list_all, quiet):
    payload = remove_dict_null({'name': name, 'framework': framework, 'engine': engine, 'version': version})
    with requests.get(f'{app_settings.api_v1_prefix}/model', params=payload) as r:
        model_list = r.json()
        model_view([MLModel.parse_obj(model) for model in model_list], list_all=list_all, quiet=quiet)