mirror of
https://github.com/tcsenpai/pensieve.git
synced 2025-06-07 03:35:24 +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
|
return None
|
||||||
|
|
||||||
async with httpx.AsyncClient() as client:
|
async with httpx.AsyncClient() as client:
|
||||||
headers = {}
|
headers = {"Authorization": f"Bearer {token}"} if token else {}
|
||||||
if token:
|
return await fetch(endpoint, client, image_base64, headers)
|
||||||
headers["Authorization"] = f"Bearer {token}"
|
|
||||||
async with semaphore:
|
|
||||||
ocr_result = await fetch(endpoint, client, image_base64, headers=headers)
|
|
||||||
return ocr_result
|
|
||||||
|
|
||||||
|
|
||||||
@router.get("/")
|
@router.get("/")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user