Sync from GitHub via hub-sync
Browse files
README.md
CHANGED
|
@@ -84,15 +84,7 @@ Most scripts here output markdown. These take a **schema** and return **structur
|
|
| 84 |
|
| 85 |
Pass `--schema` (inline JSON, a URL, or a file path). The LFM models are small and fast; run them on the `vllm/vllm-openai` image so the CUDA toolkit is present (each script's docstring has the exact command). Because `lfm2-extract.py` works on a **text** column, you can **chain it after OCR**: a recipe above turns a page into `markdown`, then `lfm2-extract.py` turns that markdown into fields.
|
| 86 |
|
| 87 |
-
`lift-extract.py` is the
|
| 88 |
-
|
| 89 |
-
```bash
|
| 90 |
-
# images or multi-page PDFs → schema-constrained JSON (9B, runs on the default image)
|
| 91 |
-
hf jobs uv run --flavor a100-large --secrets HF_TOKEN \
|
| 92 |
-
https://huggingface.co/datasets/uv-scripts/ocr/raw/main/lift-extract.py \
|
| 93 |
-
your-input-dataset your-output-dataset \
|
| 94 |
-
--schema '{"type":"object","properties":{"title":{"type":"string"}}}' --max-samples 5
|
| 95 |
-
```
|
| 96 |
|
| 97 |
```bash
|
| 98 |
# image → JSON directly
|
|
|
|
| 84 |
|
| 85 |
Pass `--schema` (inline JSON, a URL, or a file path). The LFM models are small and fast; run them on the `vllm/vllm-openai` image so the CUDA toolkit is present (each script's docstring has the exact command). Because `lfm2-extract.py` works on a **text** column, you can **chain it after OCR**: a recipe above turns a page into `markdown`, then `lfm2-extract.py` turns that markdown into fields.
|
| 86 |
|
| 87 |
+
`lift-extract.py` is the one outlier: a 9B model that also reads **multi-page PDFs** (`--pdf-column`, `--page-range`) and runs on either Transformers (`--method hf`) or vLLM (`--method vllm`). Its weights are **modified OpenRAIL-M** (free for research, personal use, and startups under $5M; no competitive use against Datalab's API) — the only non-permissive license here, so check the terms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
```bash
|
| 90 |
# image → JSON directly
|