Spaces:
Running on Zero
Running on Zero
Quota-friendlier chunking (12/chunk) and lower table/chart token caps
Browse files
app.py
CHANGED
|
@@ -59,13 +59,14 @@ PROMPTS = {
|
|
| 59 |
}
|
| 60 |
|
| 61 |
# Max new tokens per task (tables/charts can be long).
|
| 62 |
-
MAX_TOKENS = {"ocr": 1024, "table":
|
| 63 |
|
| 64 |
-
# Free ZeroGPU caps per-call duration
|
| 65 |
-
#
|
| 66 |
-
#
|
|
|
|
| 67 |
GPU_DURATION = 55
|
| 68 |
-
CHUNK =
|
| 69 |
|
| 70 |
# Map a layout label to a recognition task. Anything not listed -> "ocr".
|
| 71 |
LABEL_TO_TASK = {
|
|
|
|
| 59 |
}
|
| 60 |
|
| 61 |
# Max new tokens per task (tables/charts can be long).
|
| 62 |
+
MAX_TOKENS = {"ocr": 1024, "table": 1536, "formula": 512, "chart": 1024}
|
| 63 |
|
| 64 |
+
# Free ZeroGPU caps per-call duration (the scheduler scales the declared duration
|
| 65 |
+
# up by a safety factor, so keep it modest) AND caps total GPU-seconds/day per
|
| 66 |
+
# visitor. Process zones in chunks: few enough allocations to be quota-friendly,
|
| 67 |
+
# short enough per call to stay under the duration cap.
|
| 68 |
GPU_DURATION = 55
|
| 69 |
+
CHUNK = 12
|
| 70 |
|
| 71 |
# Map a layout label to a recognition task. Anything not listed -> "ocr".
|
| 72 |
LABEL_TO_TASK = {
|