Skip to content

Commit

Permalink
custom service.md link fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
msaroufim committed Nov 18, 2021
1 parent a96c736 commit 7d940ce
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions docs/custom_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class ModelHandler(BaseHandler):

```

Refer [waveglow_handler](../examples/text_to_speech_synthesizer/waveglow_handler.py) for more details.
Refer [waveglow_handler](https://github.com/pytorch/serve/blob/master/examples/text_to_speech_synthesizer/waveglow_handler.py) for more details.

#### Captum explanations for custom handler

Expand Down Expand Up @@ -331,12 +331,12 @@ The above ModelHandler class should have the following methods with captum funct
#### Extend default handlers

TorchServe has following default handlers.
- [image_classifier](../ts/torch_handler/image_classifier.py)
- [image_segmenter](../ts/torch_handler/image_segmenter.py)
- [object_detector](../ts/torch_handler/object_detector.py)
- [text_classifier](../ts/torch_handler/text_classifier.py)
- [image_classifier](https://github.com/pytorch/serve/blob/master/ts/torch_handler/image_classifier.py)
- [image_segmenter](https://github.com/pytorch/serve/blob/master/ts/torch_handler/image_segmenter.py)
- [object_detector](https://github.com/pytorch/serve/blob/master/ts/torch_handler/object_detector.py)
- [text_classifier](https://github.com/pytorch/serve/blob/master/ts/torch_handler/text_classifier.py)

If required above handlers can be extended to create custom handler. Also, you can extend abstract [base_handler](../ts/torch_handler/base_handler.py).
If required above handlers can be extended to create custom handler. Also, you can extend abstract [base_handler](https://github.com/pytorch/serve/blob/master/ts/torch_handler/base_handler.py).

To import the default handler in a python script use the following import statement.

Expand All @@ -360,16 +360,16 @@ class CustomImageClassifier(ImageClassifier):

```
For more details refer following examples :
- [mnist digit classifier handler](../examples/image_classifier/mnist/mnist_handler.py)
- [Huggingface transformer generalized handler](../examples/Huggingface_Transformers/Transformer_handler_generalized.py)
- [Waveglow text to speech synthesizer](../examples/text_to_speech_synthesizer/waveglow_handler.py)
- [mnist digit classifier handler](https://github.com/pytorch/serve/tree/master/examples/image_classifier)
- [Huggingface transformer generalized handler](https://github.com/pytorch/serve/blob/master/examples/Huggingface_Transformers/Transformer_handler_generalized.py)
- [Waveglow text to speech synthesizer](https://github.com/pytorch/serve/blob/master/examples/text_to_speech_synthesizer/waveglow_handler.py)

## Creating a model archive with an entry point

TorchServe identifies the entry point to the custom service from a manifest file.
When you create the model archive, specify the location of the entry point by using the `--handler` option.

The [model-archiver](../model-archiver/README.md) tool enables you to create a model archive that TorchServe can serve.
The [model-archiver](https://github.com/pytorch/serve/tree/master/model-archiver) tool enables you to create a model archive that TorchServe can serve.

```bash
torch-model-archiver --model-name <model-name> --version <model_version_number> --handler model_handler[:<entry_point_function_name>] [--model-file <path_to_model_architecture_file>] --serialized-file <path_to_state_dict_file> [--extra-files <comma_seperarted_additional_files>] [--export-path <output-dir> --model-path <model_dir>] [--runtime python3]
Expand Down Expand Up @@ -415,5 +415,5 @@ Custom models/handlers may depend on different python packages which are not ins

Following steps allows user to supply a list of custom python packages to be installed by `TorchServe` for seamless model serving.

1) [Enable model specific python package installation](configuration.md#allow-model-specific-custom-python-packages)
2) [Supply a requirements file with the model-archive](../model-archiver/README.md#torch-model-archiver-command-line-interface).
1) [Enable model specific python package installation](https://pytorch.org/serve/configuration.html#allow-model-specific-custom-python-packages)
2) [Supply a requirements file with the model-archive](https://github.com/pytorch/serve/tree/master/model-archiver#torch-model-archiver-command-line-interface).

0 comments on commit 7d940ce

Please sign in to comment.