@Override
    public ImportedModel importModel(String modelName, String modelPath) {
        try (FileInputStream inputStream = new FileInputStream(modelPath)) {
            Onnx.ModelProto model = Onnx.ModelProto.parseFrom(inputStream);
            // long version = model.getOpsetImport(0).getVersion();  // opset version

            ImportedModel importedModel = new ImportedOnnxModel(modelName, modelPath, model);
            for (int i = 0; i < model.getGraph().getOutputCount(); ++i) {
                Onnx.ValueInfoProto output = model.getGraph().getOutput(i);
                String outputName = asValidIdentifier(output.getName());
                importedModel.expression(outputName, "onnx(" + modelName + ")." + outputName);
            }
            return importedModel;

        } catch (IOException e) {
            throw new IllegalArgumentException("Could not import ONNX model from '" + modelPath + "'", e);
        }
    }
Converts a ONNX model into a ranking expression and set of constants.

@author lesters
model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/OnnxImporter.java