fix typo
Browse files- handler.py +3 -3
handler.py
CHANGED
|
@@ -13,7 +13,7 @@ class EndpointHandler():
|
|
| 13 |
"""
|
| 14 |
data args:
|
| 15 |
images (:obj:`string`)
|
| 16 |
-
|
| 17 |
Return:
|
| 18 |
A :obj:`list`:. The list contains items that are dicts should be liked {"label": "XXX", "score": 0.82}
|
| 19 |
"""
|
|
@@ -22,6 +22,6 @@ class EndpointHandler():
|
|
| 22 |
# decode base64 image to PIL
|
| 23 |
image = Image.open(BytesIO(base64.b64decode(inputs['image'])))
|
| 24 |
|
| 25 |
-
# run prediction one image wit provided
|
| 26 |
-
prediction = self.pipeline(images=[image], candidate_labels=inputs["
|
| 27 |
return prediction[0]
|
|
|
|
| 13 |
"""
|
| 14 |
data args:
|
| 15 |
images (:obj:`string`)
|
| 16 |
+
candidates (:obj:`list`)
|
| 17 |
Return:
|
| 18 |
A :obj:`list`:. The list contains items that are dicts should be liked {"label": "XXX", "score": 0.82}
|
| 19 |
"""
|
|
|
|
| 22 |
# decode base64 image to PIL
|
| 23 |
image = Image.open(BytesIO(base64.b64decode(inputs['image'])))
|
| 24 |
|
| 25 |
+
# run prediction one image wit provided candidates
|
| 26 |
+
prediction = self.pipeline(images=[image], candidate_labels=inputs["candidates"])
|
| 27 |
return prediction[0]
|