diff --git a/daras_ai_v2/exceptions.py b/daras_ai_v2/exceptions.py index 7f684e713..329e80ba4 100644 --- a/daras_ai_v2/exceptions.py +++ b/daras_ai_v2/exceptions.py @@ -5,8 +5,6 @@ from loguru import logger from requests import HTTPError -from daras_ai.image_input import truncate_filename - def raise_for_status(resp: requests.Response): """Raises :class:`HTTPError`, if one occurred.""" @@ -35,6 +33,8 @@ def raise_for_status(resp: requests.Response): def _response_preview(resp: requests.Response) -> bytes: + from daras_ai.image_input import truncate_filename + return truncate_filename(resp.content, 500, sep=b"...")