Download handler.py from huggingface-tools/text-to-video: direct link, hf CLI and curl.
- Browser
- Download file 298 Bytes
-
https://huggingface.co/huggingface-tools/text-to-video/resolve/main/handler.py
- Command line
-
hf download hf://huggingface-tools/text-to-video/handler.py
-
curl -L -o handler.py https://huggingface.co/huggingface-tools/text-to-video/resolve/main/handler.py
298 Bytes
| from transformers.tools import load_tool | |
| class EndpointHandler: | |
| def __init__(self, path=''): | |
| self.tool = load_tool('huggingface-tools/text-to-video') | |
| self.tool.setup() | |
| def __call__(self, data): | |
| inputs = data.pop("inputs", data) | |
| return self.tool(**inputs) | |