Spaces:
Running on Zero
Running on Zero
Quota-friendlier chunking (12/chunk) and lower table/chart token caps
Browse files58 unmodified lines5960616262636465666465666768686970717258 unmodified lines}
# Max new tokens per task (tables/charts can be long).MAX_TOKENS = {"ocr": 1024, "table": 2048, "formula": 512, "chart": 1536}MAX_TOKENS = {"ocr": 1024, "table": 1536, "formula": 512, "chart": 1024}
# Free ZeroGPU caps per-call duration, and the scheduler scales the declared# duration up by a safety factor. Keep each GPU allocation short and process the# page's zones in small chunks across several allocations.# Free ZeroGPU caps per-call duration (the scheduler scales the declared duration# up by a safety factor, so keep it modest) AND caps total GPU-seconds/day per# visitor. Process zones in chunks: few enough allocations to be quota-friendly,# short enough per call to stay under the duration cap.GPU_DURATION = 55CHUNK = 8CHUNK = 12
# Map a layout label to a recognition task. Anything not listed -> "ocr".LABEL_TO_TASK = {app.py+6-5