BB.Inference.Transformers.AddModelControllers (bb_inference v0.1.0)

Copy Markdown View Source

Checks each model and lowers it into a controller of the same name running BB.Inference.ModelController.

The checks:

  • the name isn't already taken by another component, so the error points at the model rather than at the controller it would have become;
  • a URL source declares a sha256;
  • archive_member is given exactly when the source is an archive;
  • the codec's options are valid against its options_schema/0. The model carries them forward with the codec's defaults applied.

It also records each model's artefact in a persisted module attribute, which the :bb_inference compiler reads from the .beam file without loading the module.

These are checks in a transformer rather than a verifier because Spark reports verifier errors as warnings, and the module still compiles.

Summary

Functions

after_compile?()

Callback implementation for Spark.Dsl.Transformer.after_compile?/0.