# Deploying onnx model with TorchServe

**URL:** <https://discuss.pytorch.org/t/deploying-onnx-model-with-torchserve/97725>\
**Category:** deployment\
**Created:** [September 29, 2020, 12:54pm UTC](https://discuss.pytorch.org/t/deploying-onnx-model-with-torchserve/97725 "2020-09-29T12:54:13Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![marksaroufim](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/marksaroufim/32/36747_2.png) [@marksaroufim](https://discuss.pytorch.org/u/marksaroufim)\
**Post date:** [February 3, 2022, 10:01pm UTC](https://discuss.pytorch.org/t/deploying-onnx-model-with-torchserve/97725/2 "2022-02-03T22:01:52Z")

</div>

There’s an easy way to do this by just loading the model from a torchserve handler which are quite general in what you can use. There’s probably a better way to do this but at a high level solution would look something like

```auto
    def load_model(self, model_path):
        options = ort.SessionOptions()
        return ort.InferenceSession(model_path, options)

```

---

_[View the full topic](https://discuss.pytorch.org/t/deploying-onnx-model-with-torchserve/97725)._
