Fix UnboundLocalError on the report-reuse path
The progress-reporter setup lived inside the generation branch; reuse skipped it but the success path still advanced the overall bar -> 'cannot access local variable progress_reporter'. Setup now runs for every path (reuse included). Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
7eb7b26786
commit
6f19719df2
@ -755,11 +755,12 @@ def _cmd_eval_run(args) -> int:
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass # unreadable/stale report: score normally
|
pass # unreadable/stale report: score normally
|
||||||
|
|
||||||
if report is None and model_spec: # generate + score in one go
|
# progress reporter setup runs for EVERY path (report reuse
|
||||||
from evalharness.model import run_eval
|
# included): the success path advances the overall bar even when
|
||||||
|
# nothing was generated -- previously this block lived inside the
|
||||||
|
# generation branch and reuse blew up with UnboundLocalError
|
||||||
progress_reporter = None
|
progress_reporter = None
|
||||||
if args.progress:
|
if args.progress and model_spec:
|
||||||
from evalharness.progress import PROGRESS_REGISTRY
|
from evalharness.progress import PROGRESS_REGISTRY
|
||||||
|
|
||||||
_pname = getattr(args, 'progress_plugin', 'rich') \
|
_pname = getattr(args, 'progress_plugin', 'rich') \
|
||||||
@ -784,6 +785,9 @@ def _cmd_eval_run(args) -> int:
|
|||||||
_shared_reporter.owned_externally = True
|
_shared_reporter.owned_externally = True
|
||||||
progress_reporter = _shared_reporter
|
progress_reporter = _shared_reporter
|
||||||
|
|
||||||
|
if report is None and model_spec: # generate + score in one go
|
||||||
|
from evalharness.model import run_eval
|
||||||
|
|
||||||
|
|
||||||
def status_callback(msg, _idx=i + 1, _name=name,
|
def status_callback(msg, _idx=i + 1, _name=name,
|
||||||
_reporter=progress_reporter,
|
_reporter=progress_reporter,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user