command.py 679 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

"""Utilities for command."""


def get_sb_command(cli, output_path, config_override):
    """Get sb command for sb-run or sb-exec.

    Args:
        cli (str): CLI name.
        output_path (str): Output directory path.
        config_override (str): Extra arguments to override config.

    Returns:
        str: Command to run.
    """
    sb_cmd = '{cli} ' \
        '--config-name=config.merge ' \
        '--config-dir={path} ' \
        'hydra.run.dir={path} ' \
        'hydra.sweep.dir={path} ' \
        '{args}'.format(cli=cli, path=output_path, args=config_override)
    return sb_cmd.strip()