Inference endpoint
Browse files- handler.py +11 -0
- requirements.txt +5 -0
handler.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers.tools import load_tool
|
2 |
+
|
3 |
+
|
4 |
+
class EndpointHandler:
|
5 |
+
def __init__(self, path=''):
|
6 |
+
self.tool = load_tool('huggingface-tools/text-to-video')
|
7 |
+
self.tool.setup()
|
8 |
+
|
9 |
+
def __call__(self, data):
|
10 |
+
inputs = data.pop("inputs", data)
|
11 |
+
return self.tool(**inputs)
|
requirements.txt
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
transformers @ git+https://github.com/huggingface/transformers@test_composition
|
2 |
+
accelerate
|
3 |
+
huggingface_hub==0.14.1
|
4 |
+
pillow
|
5 |
+
diffusers
|