Skip to content

Commit bce68c8

Browse files
author
Dylan Huang
committed
Refactor evaluator upload process to ensure secrets are always uploaded first
- Moved the call to `upload_secrets_to_fireworks` to occur before checking the evaluator status, ensuring that secrets are available for evaluation. - Removed redundant upload of secrets that was previously placed after the evaluator existence check.
1 parent 0662c00 commit bce68c8

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

eval_protocol/cli_commands/create_rft.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,14 @@ def _upload_and_ensure_evaluator(
573573
non_interactive: bool = False,
574574
) -> bool:
575575
"""Ensure the evaluator exists and is ACTIVE, uploading it if needed."""
576+
# Always upload secrets before checking evaluator status, as secrets may be
577+
# needed for evaluation even if the evaluator already exists.
578+
upload_secrets_to_fireworks(
579+
root=project_root,
580+
env_file=env_file,
581+
non_interactive=non_interactive,
582+
)
583+
576584
# Optional short-circuit: if evaluator already exists and not forcing, skip upload path
577585
if not force:
578586
try:
@@ -602,13 +610,6 @@ def _upload_and_ensure_evaluator(
602610
except requests.exceptions.RequestException:
603611
pass
604612

605-
# Upload secrets before ensuring evaluator exists
606-
upload_secrets_to_fireworks(
607-
root=project_root,
608-
env_file=env_file,
609-
non_interactive=non_interactive,
610-
)
611-
612613
# Ensure evaluator exists by invoking the upload flow programmatically
613614
try:
614615
tests = _discover_tests(project_root)

0 commit comments

Comments
 (0)