private static long calculateModelHash(ModelPathOrData model) {
        if (model.path().isPresent()) {
            try (var hasher = XXHashFactory.fastestInstance().newStreamingHash64(0);
                 var in = Files.newInputStream(Paths.get(model.path().get()))) {
                byte[] buffer = new byte[8192];
                int bytesRead;
                while ((bytesRead = in.read(buffer)) != -1) {
                    hasher.update(buffer, 0, bytesRead);
                }
                return hasher.getValue();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        } else {
            var data = model.data().get();
            return XXHashFactory.fastestInstance().hash64().hash(data, 0, data.length, 0);
        }
    }
Provides the classic embedded ONNX runtime based on the 'onnxruntime' Java library.

@author bjorncs
model-integration/src/main/java/ai/vespa/modelintegration/evaluator/EmbeddedOnnxRuntime.java