Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -141,7 +141,13 @@ class BasicAgent:
|
|
| 141 |
return transcription.text.strip()
|
| 142 |
|
| 143 |
def _load_image(self, data: str) -> Image.Image:
|
| 144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
|
| 146 |
def _load_bytes(self, data: str) -> bytes:
|
| 147 |
return base64.b64decode(data)
|
|
|
|
| 141 |
return transcription.text.strip()
|
| 142 |
|
| 143 |
def _load_image(self, data: str) -> Image.Image:
|
| 144 |
+
print_coso(f"_load_image: {data}")
|
| 145 |
+
try:
|
| 146 |
+
coso = Image.open(BytesIO(base64.b64decode(data)))
|
| 147 |
+
return coso
|
| 148 |
+
except Exception as e:
|
| 149 |
+
print_coso(f"_load_image error: {e}")
|
| 150 |
+
return None
|
| 151 |
|
| 152 |
def _load_bytes(self, data: str) -> bytes:
|
| 153 |
return base64.b64decode(data)
|