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) | |