Skip to content
heliaEDGE
Reference
HELIA

cli

helia-edge command line. Keras and TensorFlow are imported only by commands that need them.

Machine-readable model

  • appattribute
  • export_appattribute
  • DEFAULT_IOconstant
  • ModeclassHow helia-edge export create traces the model.
  • export_createfunctionBuild SPEC, load its weights, export it and write model.tflite, model.weights.h5 and record.json.
  • export_reproducefunctionExport a record's model again and compare.
  • export_schemafunctionPrint the JSON Schema of the export record (helia-edge/export-record@1).
  • inspect_modelfunctionPrint a .tflite model's inputs, outputs and operators as JSON.
  • infofunctionPrint versions, the KERASBACKEND variable and installed optional capabilities.
  • mainfunctionEntry point of the helia-edge command.
attribute

app

Python

helia_edge/cli.py:14

app = typer.Typer(no_args_is_help=True, add_completion=False, help='heliaEDGE model export tools.')
function

Build SPEC, load its weights, export it and write model.tflite, model.weights.h5 and record.json.

helia_edge/cli.py:39

export_create(
spec: Annotated[Path, typer.Argument(help='ModelSpec file (YAML or JSON).', exists=True, dir_okay=False)],
weights: Annotated[Path, typer.Option(help='A .weights.h5 file, or with --mapping the source file it imports.', exists=True)],
precision: Annotated[Precision, typer.Option(help='Numeric format of the export.')],
out: Annotated[Path, typer.Option(help='Output directory.')],
io_dtype: Annotated[str | None, typer.Option(help='I/O dtype; by default int8, int16 or the float type.')] = None,
mapping: Annotated[str | None, typer.Option(help="Weight mapping of the spec's family to import with.")] = None,
calibration: Annotated[Path | None, typer.Option(help='Calibration .npy for a8w8 and a16w8.', exists=True)] = None,
resets: Annotated[list[int] | None, typer.Option(help='Calibration step that resets the state; repeat.')] = None,
golden_inputs: Annotated[Path | None, typer.Option(help='Signal .npy for a golden@2 sequence.', exists=True)] = None,
golden_resets: Annotated[list[int] | None, typer.Option(help='Golden step that resets the state; repeat.')] = None,
batch_size: Annotated[int, typer.Option(help='Batch of the exported model.', min=1, max=2 ** 31 - 1)] = 1,
mode: Annotated[Mode, typer.Option(help='How the model is traced.')] = Mode.KERAS,
strict: Annotated[bool, typer.Option(help='For a8w8 and a16w8, refuse operators without an integer kernel.')] = True,
state_tie_tolerance: Annotated[float, typer.Option(help="Largest relative scale change when tying a state pair's scales.")] = 0.01,
require_provenance: Annotated[bool, typer.Option(help='Refuse unless helia-edge is a release or a git install at a commit.')] = False,
) -> None

Build SPEC, load its weights, export it and write model.tflite, model.weights.h5 and record.json.

Exit 1 when the install does not identify its code under –require-provenance, or the export is refused.

function

Export a record's model again and compare.

helia_edge/cli.py:119

export_reproduce(
record: Annotated[Path, typer.Argument(help='record.json written by `export create` or export().')],
weights: Annotated[Path, typer.Option(help='The weights file the record names (by digest or sha256).')],
calibration: Annotated[Path | None, typer.Option(help='The calibration .npy the record names.')] = None,
golden_inputs: Annotated[Path | None, typer.Option(help="The golden's input .npy, to compare the golden.")] = None,
allow_env_mismatch: Annotated[bool, typer.Option(help='Compare even if the environment differs; differences are listed.')] = False,
) -> None

Export a record’s model again and compare.

Exit 0 same, 1 different, 2 environment differs or cannot export, 3 missing or mismatched input, 4 the export failed (with its traceback).

function

Print the JSON Schema of the export record (helia-edge/export-record@1).

helia_edge/cli.py:154

export_schema() -> None

Print the JSON Schema of the export record (helia-edge/export-record@1).

function

Print a .tflite model's inputs, outputs and operators as JSON.

helia_edge/cli.py:162

inspect_model(model: Annotated[Path, typer.Argument(help='A .tflite model.', exists=True, dir_okay=False)]) -> None

Print a .tflite model’s inputs, outputs and operators as JSON.

function

info

Python

Print versions, the KERASBACKEND variable and installed optional capabilities.

helia_edge/cli.py:185

info() -> None

Print versions, the KERAS_BACKEND variable and installed optional capabilities.

function

main

Python

Entry point of the helia-edge command.

helia_edge/cli.py:212

main() -> None

Entry point of the helia-edge command.