app
Pythonapp = typer.Typer(no_args_is_help=True, add_completion=False, help='heliaEDGE model export tools.')helia-edge command line. Keras and TensorFlow are imported only by commands that need them.
appattributeexport_appattributeDEFAULT_IOconstantModeclassHow 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.app = typer.Typer(no_args_is_help=True, add_completion=False, help='heliaEDGE model export tools.')export_app = typer.Typer(no_args_is_help=True, help='Create and reproduce exports with their records.')DEFAULT_IO = {'fp32': 'float32', 'fp16': 'float16', 'a8w8': 'int8', 'a16w8': 'int16'}How helia-edge export create traces the model.
Mode()Build SPEC, load its weights, export it and write model.tflite, model.weights.h5 and record.json.
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,) -> NoneBuild 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.
Export a record's model again and compare.
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,) -> NoneExport 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).
Print the JSON Schema of the export record (helia-edge/export-record@1).
export_schema() -> NonePrint the JSON Schema of the export record (helia-edge/export-record@1).
Print a .tflite model's inputs, outputs and operators as JSON.
inspect_model(model: Annotated[Path, typer.Argument(help='A .tflite model.', exists=True, dir_okay=False)]) -> NonePrint a .tflite model’s inputs, outputs and operators as JSON.
Print versions, the KERASBACKEND variable and installed optional capabilities.
info() -> NonePrint versions, the KERAS_BACKEND variable and installed optional capabilities.
Entry point of the helia-edge command.
main() -> NoneEntry point of the helia-edge command.