We will discuss about Model Archiever, writing custom Handler and torchserve inferene APIs.


In plain and simple words, Handler is a Python module that defines few methods that initializes the model, preprocess data, infer from model and post-process the output (Init-Pre-Infer-Post).

  1. Initialize the model instance
  2. Pre-process input data before it is sent to the model for inference
  3. Customize how the model is invoked for inference or explanations
  4. Post-process output from the model before sending the response to the user

BaseHandler is an Abstract class for Handler which already implements most of the functionality.

Methods of BaseHandler class: initialize, preprocess, postprocess, handle, explain_handle We may need to override preprocess or postprocess based on our use case!


You can have footnotes in notebooks, however the syntax is different compared to markdown documents. This guide provides more detail about this syntax, which looks like this:

For example, here is a footnote {% fn 1 %}.
And another {% fn 2 %}
{{ 'This is the footnote.' | fndetail: 1 }}
{{ 'This is the other footnote. You can even have a [link](www.github.com)!' | fndetail: 2 }}

For example, here is a footnote 1.

And another 2

1. This is the footnote.

2. This is the other footnote. You can even have a link!