Main entry point
()
| 541 | |
| 542 | |
| 543 | def main(): |
| 544 | """Main entry point""" |
| 545 | args = parse_args() |
| 546 | |
| 547 | if args.verbose: |
| 548 | logging.getLogger().setLevel(logging.DEBUG) |
| 549 | |
| 550 | # Create evaluator |
| 551 | evaluator = SimpleQAEvaluator( |
| 552 | model=args.model, |
| 553 | approach=args.approach, |
| 554 | base_url=args.base_url, |
| 555 | grader_model=args.grader_model, |
| 556 | timeout=args.timeout, |
| 557 | cache_dir=args.cache_dir, |
| 558 | output_dir=args.output_dir, |
| 559 | use_verified=args.verified |
| 560 | ) |
| 561 | |
| 562 | try: |
| 563 | # Run evaluation |
| 564 | metrics = evaluator.run_evaluation( |
| 565 | num_samples=args.num_samples, |
| 566 | start_index=args.start_index |
| 567 | ) |
| 568 | |
| 569 | print("\n" + "="*50) |
| 570 | print("EVALUATION SUMMARY") |
| 571 | print("="*50) |
| 572 | print(f"Model: {args.model}") |
| 573 | print(f"Approach: {args.approach}") |
| 574 | print(f"Questions: {metrics['total_questions']}") |
| 575 | print(f"Accuracy: {metrics['accuracy']:.1f}%") |
| 576 | print(f"F1 Score: {metrics['f1_score']:.3f}") |
| 577 | print(f"Correct: {metrics['correct']}") |
| 578 | print(f"Incorrect: {metrics['incorrect']}") |
| 579 | print(f"Not Attempted: {metrics['not_attempted']}") |
| 580 | |
| 581 | if metrics['errors'] > 0: |
| 582 | print(f"Errors: {metrics['errors']}") |
| 583 | |
| 584 | except KeyboardInterrupt: |
| 585 | print("\nEvaluation interrupted by user") |
| 586 | except Exception as e: |
| 587 | logger.error(f"Evaluation failed: {e}") |
| 588 | raise |
| 589 | |
| 590 | |
| 591 | if __name__ == "__main__": |
no test coverage detected