From 3219f44eadc6041d8f189802a945cf46e9c14c3c Mon Sep 17 00:00:00 2001 From: Zakhar Kogan <36503576+zakhar-kogan@users.noreply.github.com> Date: Sun, 15 Dec 2024 09:48:31 +0000 Subject: [PATCH] Updated Modal with timeout and linted service.py --- src/stats/service.py | 2 +- src/storage/ocr/modal.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stats/service.py b/src/stats/service.py index 8be91657..331a5f3d 100644 --- a/src/stats/service.py +++ b/src/stats/service.py @@ -62,7 +62,7 @@ async def get_ocr_text_of_liked_memes_for_llm(user_id: int) -> list: LENGTH( REGEXP_REPLACE( MEME.ocr_result->>'text', - '[^\u0410-\u044F]', + '[^\u0410-\u044f]', '', 'g' ) diff --git a/src/storage/ocr/modal.py b/src/storage/ocr/modal.py index 17103491..d4f2fb5f 100644 --- a/src/storage/ocr/modal.py +++ b/src/storage/ocr/modal.py @@ -20,6 +20,7 @@ async def ocr_modal( params={"lang": language}, headers=HEADERS, data=file_content, + timeout=60, ) response.raise_for_status() return response.json()