Skip to content

Instantly share code, notes, and snippets.

@oborchers
Created April 3, 2021 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oborchers/6fa59eb782b610f3fc460391c2c7a8fa to your computer and use it in GitHub Desktop.
Save oborchers/6fa59eb782b610f3fc460391c2c7a8fa to your computer and use it in GitHub Desktop.
from onnxruntime import InferenceSession, SessionOptions
from onnxruntime_customops import get_library_path
opt = rt.SessionOptions()
opt.register_custom_ops_library(get_library_path())
sess = rt.InferenceSession("universal-sentence-encoder-5.onnx", opt, providers=ONNX_PROVIDERS)
sess.run(
output_names=["outputs"],
input_feed={"inputs:0": [span]},
)[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment