davanstrien HF Staff commited on
Commit
bcea357
·
verified ·
1 Parent(s): 88625a8

Add --config/--create-pr support to deepseek-ocr-vllm.py

Browse files
Files changed (1) hide show
  1. deepseek-ocr-vllm.py +22 -1
deepseek-ocr-vllm.py CHANGED
@@ -213,6 +213,8 @@ def main(
213
  private: bool = False,
214
  shuffle: bool = False,
215
  seed: int = 42,
 
 
216
  ):
217
  """Process images from HF dataset through DeepSeek-OCR model with vLLM."""
218
 
@@ -370,7 +372,15 @@ def main(
370
 
371
  # Push to hub
372
  logger.info(f"Pushing to {output_dataset}")
373
- dataset.push_to_hub(output_dataset, private=private, token=HF_TOKEN)
 
 
 
 
 
 
 
 
374
 
375
  # Create and push dataset card
376
  logger.info("Creating dataset card...")
@@ -530,6 +540,15 @@ Examples:
530
  parser.add_argument(
531
  "--private", action="store_true", help="Make output dataset private"
532
  )
 
 
 
 
 
 
 
 
 
533
  parser.add_argument(
534
  "--shuffle",
535
  action="store_true",
@@ -561,4 +580,6 @@ Examples:
561
  private=args.private,
562
  shuffle=args.shuffle,
563
  seed=args.seed,
 
 
564
  )
 
213
  private: bool = False,
214
  shuffle: bool = False,
215
  seed: int = 42,
216
+ config: str = None,
217
+ create_pr: bool = False,
218
  ):
219
  """Process images from HF dataset through DeepSeek-OCR model with vLLM."""
220
 
 
372
 
373
  # Push to hub
374
  logger.info(f"Pushing to {output_dataset}")
375
+ dataset.push_to_hub(
376
+ output_dataset,
377
+ private=private,
378
+ token=HF_TOKEN,
379
+ config_name=config,
380
+ create_pr=create_pr,
381
+ commit_message=f"Add {model} OCR results ({len(dataset)} samples)"
382
+ + (f" [{config}]" if config else ""),
383
+ )
384
 
385
  # Create and push dataset card
386
  logger.info("Creating dataset card...")
 
540
  parser.add_argument(
541
  "--private", action="store_true", help="Make output dataset private"
542
  )
543
+ parser.add_argument(
544
+ "--config",
545
+ help="Config/subset name when pushing to Hub (for benchmarking multiple models in one repo)",
546
+ )
547
+ parser.add_argument(
548
+ "--create-pr",
549
+ action="store_true",
550
+ help="Create a pull request instead of pushing directly (for parallel benchmarking)",
551
+ )
552
  parser.add_argument(
553
  "--shuffle",
554
  action="store_true",
 
580
  private=args.private,
581
  shuffle=args.shuffle,
582
  seed=args.seed,
583
+ config=args.config,
584
+ create_pr=args.create_pr,
585
  )