squanchd commited on
Commit
6191c38
1 Parent(s): f4e54f2
Files changed (2) hide show
  1. handler.py +3 -3
  2. test.py +0 -0
handler.py CHANGED
@@ -20,9 +20,9 @@ class EndpointHandler():
20
  Return:
21
  A :obj:`list` | `dict`: will be serialized and returned
22
  """
23
-
24
- words = data.pop("words", data)
25
- imageData = data.pop("image", data)
26
  image = Image.open(BytesIO(base64.b64decode(imageData)))
27
  inputs = self.processor(text=words, images=image, return_tensors="pt", padding=True)
28
  outputs = self.model(**inputs)
 
20
  Return:
21
  A :obj:`list` | `dict`: will be serialized and returned
22
  """
23
+ inputs = data.pop("inputs", data)
24
+ words = inputs["words"]
25
+ imageData = inputs["image"]
26
  image = Image.open(BytesIO(base64.b64decode(imageData)))
27
  inputs = self.processor(text=words, images=image, return_tensors="pt", padding=True)
28
  outputs = self.model(**inputs)
test.py ADDED
File without changes