mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-07 05:55:27 +03:00
fix mypy
This commit is contained in:
parent
d5effc52c0
commit
d014a3412e
@ -1,6 +1,7 @@
|
|||||||
"""Ollama Provider for Frigate AI."""
|
"""Ollama Provider for Frigate AI."""
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
|
import binascii
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, AsyncGenerator, Optional
|
from typing import Any, AsyncGenerator, Optional
|
||||||
@ -46,7 +47,7 @@ def _normalize_multimodal_content(
|
|||||||
try:
|
try:
|
||||||
encoded = url.split(",", 1)[1]
|
encoded = url.split(",", 1)[1]
|
||||||
images.append(base64.b64decode(encoded, validate=True))
|
images.append(base64.b64decode(encoded, validate=True))
|
||||||
except (ValueError, IndexError, base64.binascii.Error) as e:
|
except (ValueError, IndexError, binascii.Error) as e:
|
||||||
logger.debug("Failed to decode multimodal image url: %s", e)
|
logger.debug("Failed to decode multimodal image url: %s", e)
|
||||||
|
|
||||||
return ("\n".join(text_parts) if text_parts else None), (images or None)
|
return ("\n".join(text_parts) if text_parts else None), (images or None)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user