Spaces:
Running on Zero
Running on Zero
Quota-friendlier chunking (12/chunk) and lower table/chart token caps
Browse files58 unmodified lines5960616263646566676869707158 unmodified lines}# Max new tokens per task (tables/charts can be long).MAX_TOKENS = {"ocr": 1024, "table": 2048, "formula": 512, "chart": 1536}# 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.GPU_DURATION = 55CHUNK = 8# Map a layout label to a recognition task. Anything not listed -> "ocr".LABEL_TO_TASK = {58 unmodified lines596061626364656667686970717258 unmodified lines}# Max new tokens per task (tables/charts can be long).MAX_TOKENS = {"ocr": 1024, "table": 1536, "formula": 512, "chart": 1024}# 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 = 12# Map a layout label to a recognition task. Anything not listed -> "ocr".LABEL_TO_TASK = {
app.py+6-5