From d98eab9ebd28459c59897220a7fb1ff297822dc7 Mon Sep 17 00:00:00 2001 From: arkohut <39525455+arkohut@users.noreply.github.com> Date: Wed, 11 Sep 2024 23:20:42 +0800 Subject: [PATCH] fix: ocr fetch bug fix --- memos/plugins/ocr/main.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/memos/plugins/ocr/main.py b/memos/plugins/ocr/main.py index 399d23a..d28cfb5 100644 --- a/memos/plugins/ocr/main.py +++ b/memos/plugins/ocr/main.py @@ -96,12 +96,8 @@ async def predict(img_path): return None async with httpx.AsyncClient() as client: - headers = {} - if token: - headers["Authorization"] = f"Bearer {token}" - async with semaphore: - ocr_result = await fetch(endpoint, client, image_base64, headers=headers) - return ocr_result + headers = {"Authorization": f"Bearer {token}"} if token else {} + return await fetch(endpoint, client, image_base64, headers) @router.get("/")