Skip to content

Latest commit

 

History

History
65 lines (42 loc) · 1014 Bytes

File metadata and controls

65 lines (42 loc) · 1014 Bytes

CLI API

Command-line interface functions.

Overview

The CLI module provides the parse_cli() function for easy command-line integration.

parse_cli()

Parse configuration from command-line arguments:

import fiddledyn as dyn
import fiddle as fdl

# Parse and build
config = dyn.parse_cli()
obj = fdl.build(config)

Usage Examples

Basic Usage

# main.py
import fiddledyn as dyn
import fiddle as fdl

config = dyn.parse_cli()
obj = fdl.build(config)

Run with:

python main.py -f config.yaml model.lr=0.001

With Custom Processing

config = dyn.parse_cli()

# Apply custom transformations
if config.get('debug'):
    # Enable debug mode
    pass

obj = fdl.build(config)

Command-Line Syntax

  • -f config.yaml - Load configuration file
  • key=value - Override parameter value
  • key=@file.yaml - Load value from file

See Also