Update handler.py
Browse files- handler.py +4 -0
handler.py
CHANGED
|
@@ -21,7 +21,11 @@ class EndpointHandler():
|
|
| 21 |
print("** text: ", text)
|
| 22 |
|
| 23 |
imageData = inputs.get("image")
|
|
|
|
|
|
|
| 24 |
image = Image.open(BytesIO(base64.b64decode(imageData)))
|
|
|
|
|
|
|
| 25 |
inputs = self.processor(text=text, images=image, return_tensors="pt", padding=True)
|
| 26 |
outputs = self.model(**inputs)
|
| 27 |
embeddings = outputs.image_embeds.detach().numpy().flatten().tolist()
|
|
|
|
| 21 |
print("** text: ", text)
|
| 22 |
|
| 23 |
imageData = inputs.get("image")
|
| 24 |
+
print("** imageData: ", imageData)
|
| 25 |
+
|
| 26 |
image = Image.open(BytesIO(base64.b64decode(imageData)))
|
| 27 |
+
print("** image: ", image)
|
| 28 |
+
|
| 29 |
inputs = self.processor(text=text, images=image, return_tensors="pt", padding=True)
|
| 30 |
outputs = self.model(**inputs)
|
| 31 |
embeddings = outputs.image_embeds.detach().numpy().flatten().tolist()
|