File size: 298 Bytes
dbab1c5
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
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)