Update handler.py
Browse files- handler.py +8 -1
handler.py
CHANGED
@@ -59,9 +59,16 @@ class EndpointHandler():
|
|
59 |
# return { "embeddings": embeddings }
|
60 |
|
61 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
inputs = data.get("inputs")
|
63 |
imageBase64 = inputs.get("image")
|
64 |
-
question = inputs.get("
|
65 |
|
66 |
# data = data.pop("inputs", data)
|
67 |
# data = data.pop("image", image)
|
|
|
59 |
# return { "embeddings": embeddings }
|
60 |
|
61 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
62 |
+
# await hf.visualQuestionAnswering({
|
63 |
+
# model: 'dandelin/vilt-b32-finetuned-vqa',
|
64 |
+
# inputs: {
|
65 |
+
# question: 'How many cats are lying down?',
|
66 |
+
# image: await (await fetch('https://placekitten.com/300/300')).blob()
|
67 |
+
# }
|
68 |
+
# })
|
69 |
inputs = data.get("inputs")
|
70 |
imageBase64 = inputs.get("image")
|
71 |
+
question = inputs.get("question")
|
72 |
|
73 |
# data = data.pop("inputs", data)
|
74 |
# data = data.pop("image", image)
|