From f82d5f47349b621562a190cbd293eb795ea00370 Mon Sep 17 00:00:00 2001 From: Dev Aggarwal Date: Sun, 18 Feb 2024 15:40:54 +0530 Subject: [PATCH] fix circular import --- daras_ai_v2/exceptions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"...")