hotg-ai / rune

Rune provides containers to encapsulate and deploy edgeML pipelines and applications
Apache License 2.0
133 stars 15 forks source link

Let models have an "args" dictionary to specify the model format #367

Closed Michael-F-Bryan closed 2 years ago

Michael-F-Bryan commented 2 years ago

This gives model nodes an args field which is essentially a HashMap<String, String>.

We also let the user specify a format to indicate the format this model is in (e.g. tensorflow-lite, tensorflow, or onnx) so that information can be passed on to the runtime using our "mimetype" mechanism. If no format is provided, it will default to tensorflow-lite.

I've added a lint which warns if any arguments in the model's args dictionary haven't been consumed during the lowering process. That should help people to detect typos or when they are using a Runefile with proprietary extensions with the open-source rune CLI.

@aminhotg, @f0rodo, and @jacekpie, this integration test shows the new args and format fields, and the expected compile error shows which format values are valid. The runtime doesn't support TensorFlow or ONNX yet, but at some point we'll need to add a drop-down to let people tell us which format their model is in (technically, it can be inferred when they upload the model, but users will probably want a way to override it).

f0rodo commented 2 years ago

Awesome :)

Michael-F-Bryan commented 2 years ago

@f0rodo, this gives proprietary extensions like encryption a place to put their arguments.