Florent Gbelidji commited on
Sync DeepSeek OCR HF job code
Browse files- ds_batch_ocr/stages.py +1 -12
ds_batch_ocr/stages.py
CHANGED
|
@@ -294,18 +294,6 @@ def run_stage_extract(settings: ExtractSettings) -> None:
|
|
| 294 |
|
| 295 |
#write document with boxes image to file
|
| 296 |
img_draw.save(ctx["sample_dir"] / "document_with_boxes.png")
|
| 297 |
-
|
| 298 |
-
doc_metadata = DocumentMetadata(
|
| 299 |
-
sample_id=ctx["sample_id"],
|
| 300 |
-
dataset_index=ctx["dataset_index"],
|
| 301 |
-
document_path=document_path,
|
| 302 |
-
raw_response_path=raw_response_path,
|
| 303 |
-
source_image_path=ctx["sample_dir"] / "source.png",
|
| 304 |
-
document_with_boxes_path=ctx["sample_dir"] / "document_with_boxes.png",
|
| 305 |
-
document_markdown_text=markdown,
|
| 306 |
-
extracted_figures=figures,
|
| 307 |
-
extracted_figures_metadata=figures_metadata,
|
| 308 |
-
)
|
| 309 |
|
| 310 |
#build document metadata
|
| 311 |
batch_document_dicts.append(
|
|
@@ -444,6 +432,7 @@ def run_stage_extract(settings: ExtractSettings) -> None:
|
|
| 444 |
|
| 445 |
#documents_iter_for_push = iter_documents_from_batches(document_batch_files)
|
| 446 |
#dataset_records_iter = _build_dataset_records_iter(documents_iter_for_push)
|
|
|
|
| 447 |
_push_dataset_records(
|
| 448 |
records_files=document_batch_files,
|
| 449 |
output_dir=settings.output_dir,
|
|
|
|
| 294 |
|
| 295 |
#write document with boxes image to file
|
| 296 |
img_draw.save(ctx["sample_dir"] / "document_with_boxes.png")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 297 |
|
| 298 |
#build document metadata
|
| 299 |
batch_document_dicts.append(
|
|
|
|
| 432 |
|
| 433 |
#documents_iter_for_push = iter_documents_from_batches(document_batch_files)
|
| 434 |
#dataset_records_iter = _build_dataset_records_iter(documents_iter_for_push)
|
| 435 |
+
LOGGER.info(document_batch_files)
|
| 436 |
_push_dataset_records(
|
| 437 |
records_files=document_batch_files,
|
| 438 |
output_dir=settings.output_dir,
|