Sync from GitHub via hub-sync
Browse files- glm-ocr.py +13 -4
- nanonets-ocr.py +12 -5
- rolm-ocr.py +12 -5
glm-ocr.py
CHANGED
|
@@ -199,6 +199,15 @@ def create_dataset_card(
|
|
| 199 |
"table": "table recognition",
|
| 200 |
}
|
| 201 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
return f"""---
|
| 203 |
tags:
|
| 204 |
- ocr
|
|
@@ -206,7 +215,7 @@ tags:
|
|
| 206 |
- glm-ocr
|
| 207 |
- markdown
|
| 208 |
- uv-script
|
| 209 |
-
- generated
|
| 210 |
---
|
| 211 |
|
| 212 |
# Document OCR using {model_name}
|
|
@@ -252,16 +261,16 @@ The dataset contains all original columns plus:
|
|
| 252 |
|
| 253 |
## Reproduction
|
| 254 |
|
|
|
|
|
|
|
| 255 |
```bash
|
| 256 |
-
uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/glm-ocr.py \\
|
| 257 |
{source_dataset} \\
|
| 258 |
<output-dataset> \\
|
| 259 |
--image-column {image_column} \\
|
| 260 |
--batch-size {batch_size} \\
|
| 261 |
--task {task}
|
| 262 |
```
|
| 263 |
-
|
| 264 |
-
Generated with [UV Scripts](https://huggingface.co/uv-scripts)
|
| 265 |
"""
|
| 266 |
|
| 267 |
|
|
|
|
| 199 |
"table": "table recognition",
|
| 200 |
}
|
| 201 |
|
| 202 |
+
# Canonical provenance stamp (see AGENTS.md): Jobs claim gated on JOB_ID, set by HF Jobs in-container.
|
| 203 |
+
on_jobs = os.environ.get("JOB_ID") is not None
|
| 204 |
+
hw = os.environ.get("ACCELERATOR") or ""
|
| 205 |
+
origin = (
|
| 206 |
+
"Produced on [Hugging Face Jobs](https://huggingface.co/docs/huggingface_hub/guides/jobs)"
|
| 207 |
+
+ (f" (`{hw}`)" if hw else "")
|
| 208 |
+
) if on_jobs else "Generated"
|
| 209 |
+
jobs_tag = "\n- hf-jobs" if on_jobs else ""
|
| 210 |
+
|
| 211 |
return f"""---
|
| 212 |
tags:
|
| 213 |
- ocr
|
|
|
|
| 215 |
- glm-ocr
|
| 216 |
- markdown
|
| 217 |
- uv-script
|
| 218 |
+
- generated{jobs_tag}
|
| 219 |
---
|
| 220 |
|
| 221 |
# Document OCR using {model_name}
|
|
|
|
| 261 |
|
| 262 |
## Reproduction
|
| 263 |
|
| 264 |
+
{origin} with the [`glm-ocr.py`](https://huggingface.co/datasets/uv-scripts/ocr/raw/main/glm-ocr.py) recipe from [uv-scripts](https://huggingface.co/uv-scripts). Run it yourself:
|
| 265 |
+
|
| 266 |
```bash
|
| 267 |
+
hf jobs uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/glm-ocr.py \\
|
| 268 |
{source_dataset} \\
|
| 269 |
<output-dataset> \\
|
| 270 |
--image-column {image_column} \\
|
| 271 |
--batch-size {batch_size} \\
|
| 272 |
--task {task}
|
| 273 |
```
|
|
|
|
|
|
|
| 274 |
"""
|
| 275 |
|
| 276 |
|
nanonets-ocr.py
CHANGED
|
@@ -130,6 +130,15 @@ def create_dataset_card(
|
|
| 130 |
"""Create a dataset card documenting the OCR process."""
|
| 131 |
model_name = model.split("/")[-1]
|
| 132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
return f"""---
|
| 134 |
viewer: false
|
| 135 |
tags:
|
|
@@ -138,7 +147,7 @@ tags:
|
|
| 138 |
- nanonets
|
| 139 |
- markdown
|
| 140 |
- uv-script
|
| 141 |
-
- generated
|
| 142 |
---
|
| 143 |
|
| 144 |
# Document OCR using {model_name}
|
|
@@ -202,10 +211,10 @@ for info in inference_info:
|
|
| 202 |
|
| 203 |
## Reproduction
|
| 204 |
|
| 205 |
-
|
| 206 |
|
| 207 |
```bash
|
| 208 |
-
uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/nanonets-ocr.py \\
|
| 209 |
{source_dataset} \\
|
| 210 |
<output-dataset> \\
|
| 211 |
--image-column {image_column} \\
|
|
@@ -219,8 +228,6 @@ uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/nanonets-ocr.py \
|
|
| 219 |
|
| 220 |
- **Processing Speed**: ~{num_samples / (float(processing_time.split()[0]) * 60):.1f} images/second
|
| 221 |
- **GPU Configuration**: vLLM with {gpu_memory_utilization:.0%} GPU memory utilization
|
| 222 |
-
|
| 223 |
-
Generated with 🤖 [UV Scripts](https://huggingface.co/uv-scripts)
|
| 224 |
"""
|
| 225 |
|
| 226 |
|
|
|
|
| 130 |
"""Create a dataset card documenting the OCR process."""
|
| 131 |
model_name = model.split("/")[-1]
|
| 132 |
|
| 133 |
+
# Canonical provenance stamp (see AGENTS.md): Jobs claim gated on JOB_ID, set by HF Jobs in-container.
|
| 134 |
+
on_jobs = os.environ.get("JOB_ID") is not None
|
| 135 |
+
hw = os.environ.get("ACCELERATOR") or ""
|
| 136 |
+
origin = (
|
| 137 |
+
"Produced on [Hugging Face Jobs](https://huggingface.co/docs/huggingface_hub/guides/jobs)"
|
| 138 |
+
+ (f" (`{hw}`)" if hw else "")
|
| 139 |
+
) if on_jobs else "Generated"
|
| 140 |
+
jobs_tag = "\n- hf-jobs" if on_jobs else ""
|
| 141 |
+
|
| 142 |
return f"""---
|
| 143 |
viewer: false
|
| 144 |
tags:
|
|
|
|
| 147 |
- nanonets
|
| 148 |
- markdown
|
| 149 |
- uv-script
|
| 150 |
+
- generated{jobs_tag}
|
| 151 |
---
|
| 152 |
|
| 153 |
# Document OCR using {model_name}
|
|
|
|
| 211 |
|
| 212 |
## Reproduction
|
| 213 |
|
| 214 |
+
{origin} with the [`nanonets-ocr.py`](https://huggingface.co/datasets/uv-scripts/ocr/raw/main/nanonets-ocr.py) recipe from [uv-scripts](https://huggingface.co/uv-scripts). Run it yourself:
|
| 215 |
|
| 216 |
```bash
|
| 217 |
+
hf jobs uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/nanonets-ocr.py \\
|
| 218 |
{source_dataset} \\
|
| 219 |
<output-dataset> \\
|
| 220 |
--image-column {image_column} \\
|
|
|
|
| 228 |
|
| 229 |
- **Processing Speed**: ~{num_samples / (float(processing_time.split()[0]) * 60):.1f} images/second
|
| 230 |
- **GPU Configuration**: vLLM with {gpu_memory_utilization:.0%} GPU memory utilization
|
|
|
|
|
|
|
| 231 |
"""
|
| 232 |
|
| 233 |
|
rolm-ocr.py
CHANGED
|
@@ -131,6 +131,15 @@ def create_dataset_card(
|
|
| 131 |
"""Create a dataset card documenting the OCR process."""
|
| 132 |
model_name = model.split("/")[-1]
|
| 133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
return f"""---
|
| 135 |
viewer: false
|
| 136 |
tags:
|
|
@@ -138,7 +147,7 @@ tags:
|
|
| 138 |
- text-extraction
|
| 139 |
- rolmocr
|
| 140 |
- uv-script
|
| 141 |
-
- generated
|
| 142 |
---
|
| 143 |
|
| 144 |
# OCR Text Extraction using {model_name}
|
|
@@ -195,10 +204,10 @@ for info in inference_info:
|
|
| 195 |
|
| 196 |
## Reproduction
|
| 197 |
|
| 198 |
-
|
| 199 |
|
| 200 |
```bash
|
| 201 |
-
uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/rolm-ocr.py \\
|
| 202 |
{source_dataset} \\
|
| 203 |
<output-dataset> \\
|
| 204 |
--image-column {image_column} \\
|
|
@@ -212,8 +221,6 @@ uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/rolm-ocr.py \\
|
|
| 212 |
|
| 213 |
- **Processing Speed**: ~{num_samples / (float(processing_time.split()[0]) * 60):.1f} images/second
|
| 214 |
- **GPU Configuration**: vLLM with {gpu_memory_utilization:.0%} GPU memory utilization
|
| 215 |
-
|
| 216 |
-
Generated with 🤖 [UV Scripts](https://huggingface.co/uv-scripts)
|
| 217 |
"""
|
| 218 |
|
| 219 |
|
|
|
|
| 131 |
"""Create a dataset card documenting the OCR process."""
|
| 132 |
model_name = model.split("/")[-1]
|
| 133 |
|
| 134 |
+
# Canonical provenance stamp (see AGENTS.md): Jobs claim gated on JOB_ID, set by HF Jobs in-container.
|
| 135 |
+
on_jobs = os.environ.get("JOB_ID") is not None
|
| 136 |
+
hw = os.environ.get("ACCELERATOR") or ""
|
| 137 |
+
origin = (
|
| 138 |
+
"Produced on [Hugging Face Jobs](https://huggingface.co/docs/huggingface_hub/guides/jobs)"
|
| 139 |
+
+ (f" (`{hw}`)" if hw else "")
|
| 140 |
+
) if on_jobs else "Generated"
|
| 141 |
+
jobs_tag = "\n- hf-jobs" if on_jobs else ""
|
| 142 |
+
|
| 143 |
return f"""---
|
| 144 |
viewer: false
|
| 145 |
tags:
|
|
|
|
| 147 |
- text-extraction
|
| 148 |
- rolmocr
|
| 149 |
- uv-script
|
| 150 |
+
- generated{jobs_tag}
|
| 151 |
---
|
| 152 |
|
| 153 |
# OCR Text Extraction using {model_name}
|
|
|
|
| 204 |
|
| 205 |
## Reproduction
|
| 206 |
|
| 207 |
+
{origin} with the [`rolm-ocr.py`](https://huggingface.co/datasets/uv-scripts/ocr/raw/main/rolm-ocr.py) recipe from [uv-scripts](https://huggingface.co/uv-scripts). Run it yourself:
|
| 208 |
|
| 209 |
```bash
|
| 210 |
+
hf jobs uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/rolm-ocr.py \\
|
| 211 |
{source_dataset} \\
|
| 212 |
<output-dataset> \\
|
| 213 |
--image-column {image_column} \\
|
|
|
|
| 221 |
|
| 222 |
- **Processing Speed**: ~{num_samples / (float(processing_time.split()[0]) * 60):.1f} images/second
|
| 223 |
- **GPU Configuration**: vLLM with {gpu_memory_utilization:.0%} GPU memory utilization
|
|
|
|
|
|
|
| 224 |
"""
|
| 225 |
|
| 226 |
|