allenai / allenai/olmocr

Document if multiple instances can use the same workspace

Aperta
#470 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Python
Stelle
19.5k
Fork
1.6k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### πŸ› Describe the bug

So, this might seem like a silly thing, but I find it hard to understand how the workers and the workspaces relate.

For example, I have an instance running on a few hundred images (not PDFs):

`$ olmocr ../archives/olmocr_workspace/ --markdown --pdfs ../archives/barch/R_58_5853e/*.jpg --server http://localhost:8000/v1 --model allenai/olmOCR-2-7B-1025-FP8`

This first reports converting the jpgs to PDFs:

```
2026-07-05 15:18:33,101 - olmocr.pipeline - INFO - Loading file at ../archives/barch/R_58_5853e/R_58_5853_e_0001.jpg as image document
2026-07-05 15:18:33,101 - olmocr.pipeline - INFO - Loading file at ../archives/barch/R_58_5853e/R_58_5853_e_0002.jpg as image document
2026-07-05 15:18:33,106 - olmocr.pipeline - INFO - Loading file at ../archives/barch/R_58_5853e/R_58_5853_e_0003.jpg as image document
2026-07-05 15:18:33,110 - olmocr.pipeline - INFO - Loading file at ../archives/barch/R_58_5853e/R_58_5853_e_0004.jpg as image document
...
```

Now, while this is running, is it safe to start another olmocr command using the same workspace with a different set of files?

Or is it possible to have one persistent worker-olmocr and use other olmocr invocations to just add documents to it?

I tried running this while the previous olmocr instance was still running, and it announced it's converting to PDF files *from the previous run* (incidentally, I'm very confused about what `--pdfs` does):

```
$ olmocr ../archives/olmocr_workspace/ --markdown --pdfs ../archives/barch/RM_98_1196__ktb_uboote/* --server http://localhost:8000/v1 --model allenai/olmOCR-2-7B-1025-FP8
...
2026-07-05 16:24:03,945 - olmocr.pipeline - INFO - Got --pdfs argument, going to add to the work queue
2026-07-05 16:24:03,946 - olmocr.pipeline - INFO - Loading file at ../archives/barch/RM_98_1196__ktb_uboote/RM_98_1196_0001.jpg as image document
2026-07-05 16:24:03,946 - olmocr.pipeline - INFO - Loading file at ../archives/barch/RM_98_1196__ktb_uboote/RM_98_1196_0005.jpg as image document
...
2026-07-05 16:24:03,983 - olmocr.pipeline - INFO - Loading file at ../archives/barch/RM_98_1196__ktb_uboote/RM_98_1196_0415.jpg as image document
2026-07-05 16:24:03,983 - olmocr.pipeline - INFO - Loading file at ../archives/barch/RM_98_1196__ktb_uboote/RM_98_1196_0417.jpg as image document
2026-07-05 16:24:03,984 - olmocr.pipeline - INFO - Loading file at ../archives/barch/RM_98_1196__ktb_uboote/RM_98_1196_0418.jpg as image document
2026-07-05 16:24:03,984 - olmocr.pipeline - INFO - Found 381 regular pdf paths and 0 tarballs to add
Sampling PDFs to calculate optimal length: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 100/100 [00:00<00:00, 186.11it/s]
2026-07-05 16:24:04,526 - olmocr.pipeline - INFO - Calculated items_per_group: 500 based on average pages per PDF: 1.00
2026-07-05 16:24:04,533 - olmocr.pipeline - INFO - Starting pipeline with PID 221876
2026-07-05 16:24:04,533 - olmocr.pipeline - INFO - Using external server at http://localhost:8000/v1
INFO:olmocr.work_queue:Initialized queue with 2 work items
INFO:httpx:HTTP Request: GET http://localhost:8000/v1/models "HTTP/1.1 200 OK"
2026-07-05 16:24:04,554 - olmocr.pipeline - INFO - vllm server is ready.
2026-07-05 16:24:04,554 - olmocr.pipeline - INFO - Queue remaining: 2
2026-07-05 16:24:04,554 - olmocr.pipeline - INFO -
Metric Name Lifetime (tokens/sec) Recently (tokens/sec)
----------------------------------------------------------------------------------
2026-07-05 16:24:04,554 - olmocr.pipeline - INFO -
Worker ID
---------
2026-07-05 16:24:04,555 - olmocr.pipeline - INFO - Worker 2 exiting due to empty queue
2026-07-05 16:24:04,555 - olmocr.pipeline - INFO - Worker 3 exiting due to empty queue
2026-07-05 16:24:04,555 - olmocr.pipeline - INFO - Worker 4 exiting due to empty queue
2026-07-05 16:24:04,555 - olmocr.pipeline - INFO - Worker 5 exiting due to empty queue
2026-07-05 16:24:04,555 - olmocr.pipeline - INFO - Worker 6 exiting due to empty queue
2026-07-05 16:24:04,555 - olmocr.pipeline - INFO - Worker 7 exiting due to empty queue
2026-07-05 16:24:04,555 - olmocr.pipeline - INFO - Worker 8 exiting due to empty queue
2026-07-05 16:24:04,555 - olmocr.pipeline - INFO - Worker 9 exiting due to empty queue
2026-07-05 16:24:04,555 - olmocr.pipeline - INFO - Worker 10 exiting due to empty queue
2026-07-05 16:24:04,555 - olmocr.pipeline - INFO - Worker 11 exiting due to empty queue
2026-07-05 16:24:04,555 - olmocr.pipeline - INFO - Worker 12 exiting due to empty queue
2026-07-05 16:24:04,555 - olmocr.pipeline - INFO - Worker 13 exiting due to empty queue
2026-07-05 16:24:04,555 - olmocr.pipeline - INFO - Worker 14 exiting due to empty queue
2026-07-05 16:24:04,555 - olmocr.pipeline - INFO - Worker 15 exiting due to empty queue
2026-07-05 16:24:04,555 - olmocr.pipeline - INFO - Worker 16 exiting due to empty queue
2026-07-05 16:24:04,555 - olmocr.pipeline - INFO - Worker 17 exiting due to empty queue
2026-07-05 16:24:04,555 - olmocr.pipeline - INFO - Worker 18 exiting due to empty queue
2026-07-05 16:24:04,555 - olmocr.pipeline - INFO - Worker 19 exiting due to empty queue
2026-07-05 16:24:04,556 - olmocr.pipeline - INFO - Worker 0 processing work item 1bd628c581c8afad525c64d3f20d38d72ee91c21
2026-07-05 16:24:04,557 - olmocr.pipeline - INFO - Created all tasks for 1bd628c581c8afad525c64d3f20d38d72ee91c21
2026-07-05 16:24:05,349 - olmocr.pipeline - INFO - Converting ../archives/barch/R_58_5853e/R_58_5853_e_0255.jpg from image to PDF format...
2026-07-05 16:24:05,642 - olmocr.pipeline - INFO - Converting ../archives/barch/R_58_5853e/R_58_5853_e_0276.jpg from image to PDF format...
2026-07-05 16:24:05,977 - olmocr.pipeline - INFO - Converting ../archives/barch/R_58_5853e/R_58_5853_e_0324.jpg from image to PDF format...
2026-07-05 16:24:06,733 - olmocr.pipeline - INFO - Converting ../archives/barch/R_58_5853e/R_58_5853_e_0003.jpg from image to PDF format...
2026-07-05 16:24:06,956 - olmocr.pipeline - INFO - Converting ../archives/barch/R_58_5853e/R_58_5853_e_0004.jpg from image to PDF format...
```

Here the R_58_* files are ones being processed in the other olmocr invocation. This makes me suspect it's not really designed to allow two olmocrs to use the same workspace?

### Versions

$ uv run python --version
Python 3.14.3

No pip here, but here's `uv tree` output:

$ uv tree
Resolved 77 packages in 1ms
ocr v0.1.0
β”œβ”€β”€ olmocr v0.4.27
β”‚ β”œβ”€β”€ bleach v6.4.0
β”‚ β”‚ └── webencodings v0.5.1
β”‚ β”œβ”€β”€ boto3 v1.43.40
β”‚ β”‚ β”œβ”€β”€ botocore v1.43.40
β”‚ β”‚ β”‚ β”œβ”€β”€ jmespath v1.1.0
β”‚ β”‚ β”‚ β”œβ”€β”€ python-dateutil v2.9.0.post0
β”‚ β”‚ β”‚ β”‚ └── six v1.17.0
β”‚ β”‚ β”‚ └── urllib3 v2.7.0
β”‚ β”‚ β”œβ”€β”€ jmespath v1.1.0
β”‚ β”‚ └── s3transfer v0.19.0
β”‚ β”‚ └── botocore v1.43.40 (*)
β”‚ β”œβ”€β”€ cached-path v1.8.10
β”‚ β”‚ β”œβ”€β”€ boto3 v1.43.40 (*)
β”‚ β”‚ β”œβ”€β”€ filelock v3.29.5
β”‚ β”‚ β”œβ”€β”€ google-cloud-storage v3.12.0
β”‚ β”‚ β”‚ β”œβ”€β”€ google-api-core v2.31.0
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ google-auth v2.55.1
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ cryptography v49.0.0
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ └── cffi v2.0.0
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ └── pycparser v3.0
β”‚ β”‚ β”‚ β”‚ β”‚ └── pyasn1-modules v0.4.2
β”‚ β”‚ β”‚ β”‚ β”‚ └── pyasn1 v0.6.3
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ googleapis-common-protos v1.75.0
β”‚ β”‚ β”‚ β”‚ β”‚ └── protobuf v7.35.1
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ proto-plus v1.28.0
β”‚ β”‚ β”‚ β”‚ β”‚ └── protobuf v7.35.1
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ protobuf v7.35.1
β”‚ β”‚ β”‚ β”‚ └── requests v2.34.2
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ certifi v2026.6.17
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ charset-normalizer v3.4.7
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ idna v3.18
β”‚ β”‚ β”‚ β”‚ └── urllib3 v2.7.0
β”‚ β”‚ β”‚ β”œβ”€β”€ google-auth v2.55.1 (*)
β”‚ β”‚ β”‚ β”œβ”€β”€ google-cloud-core v2.6.0
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ google-api-core v2.31.0 (*)
β”‚ β”‚ β”‚ β”‚ └── google-auth v2.55.1 (*)
β”‚ β”‚ β”‚ β”œβ”€β”€ google-crc32c v1.8.0
β”‚ β”‚ β”‚ β”œβ”€β”€ google-resumable-media v2.10.0
β”‚ β”‚ β”‚ β”‚ └── google-crc32c v1.8.0
β”‚ β”‚ β”‚ └── requests v2.34.2 (*)
β”‚ β”‚ β”œβ”€β”€ huggingface-hub v1.22.0
β”‚ β”‚ β”‚ β”œβ”€β”€ click v8.4.2
β”‚ β”‚ β”‚ β”œβ”€β”€ filelock v3.29.5
β”‚ β”‚ β”‚ β”œβ”€β”€ fsspec v2026.6.0
β”‚ β”‚ β”‚ β”œβ”€β”€ hf-xet v1.5.1
β”‚ β”‚ β”‚ β”œβ”€β”€ httpx v0.28.1
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ anyio v4.14.1
β”‚ β”‚ β”‚ β”‚ β”‚ └── idna v3.18
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ certifi v2026.6.17
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ httpcore v1.0.9
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ certifi v2026.6.17
β”‚ β”‚ β”‚ β”‚ β”‚ └── h11 v0.16.0
β”‚ β”‚ β”‚ β”‚ └── idna v3.18
β”‚ β”‚ β”‚ β”œβ”€β”€ packaging v26.2
β”‚ β”‚ β”‚ β”œβ”€β”€ pyyaml v6.0.3
β”‚ β”‚ β”‚ β”œβ”€β”€ tqdm v4.68.3
β”‚ β”‚ β”‚ └── typing-extensions v4.16.0
β”‚ β”‚ β”œβ”€β”€ packaging v26.2
β”‚ β”‚ β”œβ”€β”€ requests v2.34.2 (*)
β”‚ β”‚ └── rich v13.9.4
β”‚ β”‚ β”œβ”€β”€ markdown-it-py v4.2.0
β”‚ β”‚ β”‚ └── mdurl v0.1.2
β”‚ β”‚ └── pygments v2.20.0
β”‚ β”œβ”€β”€ cryptography v49.0.0 (*)
β”‚ β”œβ”€β”€ filelock v3.29.5
β”‚ β”œβ”€β”€ ftfy v6.3.1
β”‚ β”‚ └── wcwidth v0.8.2
β”‚ β”œβ”€β”€ httpx v0.28.1 (*)
β”‚ β”œβ”€β”€ lingua-language-detector v2.2.0
β”‚ β”œβ”€β”€ markdown2 v2.5.5
β”‚ β”œβ”€β”€ markdownify v1.2.3
β”‚ β”‚ β”œβ”€β”€ beautifulsoup4 v4.15.0
β”‚ β”‚ β”‚ β”œβ”€β”€ soupsieve v2.8.4
β”‚ β”‚ β”‚ └── typing-extensions v4.16.0
β”‚ β”‚ └── six v1.17.0
β”‚ β”œβ”€β”€ orjson v3.11.9
β”‚ β”œβ”€β”€ pillow v12.3.0
β”‚ β”œβ”€β”€ pypdf v6.14.2
β”‚ β”œβ”€β”€ pypdfium2 v5.11.0
β”‚ β”œβ”€β”€ requests v2.34.2 (*)
β”‚ β”œβ”€β”€ smart-open v8.0.0
β”‚ β”‚ └── wrapt v2.2.2
β”‚ └── zstandard v0.25.0
└── ipython v9.15.0 (group: dev)
β”œβ”€β”€ decorator v5.3.1
β”œβ”€β”€ ipython-pygments-lexers v1.1.1
β”‚ └── pygments v2.20.0
β”œβ”€β”€ jedi v0.20.0
β”‚ └── parso v0.8.7
β”œβ”€β”€ matplotlib-inline v0.2.2
β”‚ └── traitlets v5.15.1
β”œβ”€β”€ pexpect v4.9.0
β”‚ └── ptyprocess v0.7.0
β”œβ”€β”€ prompt-toolkit v3.0.52
β”‚ └── wcwidth v0.8.2
β”œβ”€β”€ psutil v7.2.2
β”œβ”€β”€ pygments v2.20.0
β”œβ”€β”€ stack-data v0.6.3
β”‚ β”œβ”€β”€ asttokens v3.0.1
β”‚ β”œβ”€β”€ executing v2.2.1
β”‚ └── pure-eval v0.2.3
└── traitlets v5.15.1
(*) Package tree already displayed

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non Γ¨ ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.