Download handler.py from nateraw/hello-world-handler: direct link, hf CLI and curl.
- Browser
- Download file 396 Bytes
-
https://huggingface.co/nateraw/hello-world-handler/resolve/main/handler.py
- Command line
-
hf download hf://nateraw/hello-world-handler/handler.py
-
curl -L -o handler.py https://huggingface.co/nateraw/hello-world-handler/resolve/main/handler.py
396 Bytes
| class EndpointHandler(): | |
| def __init__(self, path=""): | |
| pass | |
| def __call__(self, data): | |
| """ | |
| Args: | |
| data (:obj:): | |
| includes the input data and the parameters for the inference. | |
| Return: | |
| A :obj:`dict`:. base64 encoded image | |
| """ | |
| inputs = data.pop("inputs", data) | |
| return [f"Hello, {x}" for x in inputs] |