Upload paddleocr-vl-1.5.py with huggingface_hub
Browse files- paddleocr-vl-1.5.py +3 -0
paddleocr-vl-1.5.py
CHANGED
|
@@ -418,8 +418,10 @@ def main(
|
|
| 418 |
# Note: Batch processing with transformers VLMs can be unreliable,
|
| 419 |
# so we process individually for stability
|
| 420 |
all_outputs = []
|
|
|
|
| 421 |
|
| 422 |
for i in tqdm(range(len(dataset)), desc=f"PaddleOCR-VL-1.5 {task_mode.upper()}"):
|
|
|
|
| 423 |
try:
|
| 424 |
# Prepare image and create message
|
| 425 |
image = dataset[i][image_column]
|
|
@@ -454,6 +456,7 @@ def main(
|
|
| 454 |
generated_ids = outputs[0, input_len:]
|
| 455 |
result = processor.decode(generated_ids, skip_special_tokens=True)
|
| 456 |
all_outputs.append(result.strip())
|
|
|
|
| 457 |
|
| 458 |
except Exception as e:
|
| 459 |
logger.error(f"Error processing image {i}: {e}")
|
|
|
|
| 418 |
# Note: Batch processing with transformers VLMs can be unreliable,
|
| 419 |
# so we process individually for stability
|
| 420 |
all_outputs = []
|
| 421 |
+
logger.info("Starting image processing loop...")
|
| 422 |
|
| 423 |
for i in tqdm(range(len(dataset)), desc=f"PaddleOCR-VL-1.5 {task_mode.upper()}"):
|
| 424 |
+
logger.info(f"Processing image {i+1}/{len(dataset)}...")
|
| 425 |
try:
|
| 426 |
# Prepare image and create message
|
| 427 |
image = dataset[i][image_column]
|
|
|
|
| 456 |
generated_ids = outputs[0, input_len:]
|
| 457 |
result = processor.decode(generated_ids, skip_special_tokens=True)
|
| 458 |
all_outputs.append(result.strip())
|
| 459 |
+
logger.info(f"Image {i+1} done. Output length: {len(result)} chars")
|
| 460 |
|
| 461 |
except Exception as e:
|
| 462 |
logger.error(f"Error processing image {i}: {e}")
|