caikit.runtime.train

This module is a central entrypoint for running a single synchronous training job using caikit.core.train

Attributes

log

error

USER_ERROR_EXIT_CODE

INTERNAL_ERROR_EXIT_CODE

Exceptions

ArgumentParserError

Custom exception class for ArgumentParser errors.

Classes

TrainArgumentParser

Object for parsing command line strings into Python objects.

Functions

write_termination_log(text, log_file, enabled)

exit_complete(exit_code, save_path, message, ...)

main(→ int)

Main entrypoint for running training jobs

Module Contents

caikit.runtime.train.log[source]
caikit.runtime.train.error
caikit.runtime.train.USER_ERROR_EXIT_CODE = 1
caikit.runtime.train.INTERNAL_ERROR_EXIT_CODE = 203
exception caikit.runtime.train.ArgumentParserError[source]

Bases: Exception

Custom exception class for ArgumentParser errors.

class caikit.runtime.train.TrainArgumentParser(prog=None, usage=None, description=None, epilog=None, parents=[], formatter_class=HelpFormatter, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True, allow_abbrev=True, exit_on_error=True)[source]

Bases: argparse.ArgumentParser

Object for parsing command line strings into Python objects.

Keyword Arguments:
  • prog – The name of the program (default:

    os.path.basename(sys.argv[0]))

  • usage – A usage message (default: auto-generated from arguments)

  • description – A description of what the program does

  • epilog – Text following the argument descriptions

  • parents – Parsers whose arguments should be copied into this one

  • formatter_class – HelpFormatter class for printing help messages

  • prefix_chars – Characters that prefix optional arguments

  • fromfile_prefix_chars – Characters that prefix files containing

    additional arguments

  • argument_default – The default value for all arguments

  • conflict_handler – String indicating how to handle conflicts

  • add_help – Add a -h/-help option

  • allow_abbrev – Allow long options to be abbreviated unambiguously

  • exit_on_error – Determines whether or not ArgumentParser exits with

    error info when an error occurs

error(message)[source]

Error handler that raises an exception instead of exiting.

caikit.runtime.train.write_termination_log(text: str, log_file: str, enabled: bool)[source]
caikit.runtime.train.exit_complete(exit_code: int, save_path: str, message: str, termination_log_file: str, enable_termination_log: bool)[source]
caikit.runtime.train.main() int[source]

Main entrypoint for running training jobs