mirror of
https://github.com/tcsenpai/pensieve.git
synced 2025-06-06 03:05:25 +00:00
fix: ocr fetch bug fix
This commit is contained in:
parent
dbbc2792ef
commit
d98eab9ebd
@ -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("/")
|
||||
|
Loading…
x
Reference in New Issue
Block a user