Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions eval_protocol/cli_commands/create_rft.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,13 @@ def _create_rft_job(
print(f"Prepared RFT job for evaluator '{evaluator_id}' using dataset '{dataset_id}'")
if getattr(args, "evaluation_dataset", None):
body["evaluationDataset"] = args.evaluation_dataset
if getattr(args, "output_model", None):
body.setdefault("trainingConfig", {})["outputModel"] = f"accounts/{account_id}/models/{args.output_model}"

output_model_arg = getattr(args, "output_model", None)
if output_model_arg:
if len(output_model_arg) > 63:
print(f"Error: Output model name '{output_model_arg}' exceeds 63 characters.")
return 1
body.setdefault("trainingConfig", {})["outputModel"] = f"accounts/{account_id}/models/{output_model_arg}"
else:
# Auto-generate output model name if not provided
auto_output_model = build_default_output_model(evaluator_id)
Expand Down
19 changes: 19 additions & 0 deletions eval_protocol/fireworks_rft.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import tempfile
import time
import uuid
import hashlib
from pathlib import Path
from typing import Any, Callable, Dict, Iterable, Optional, Tuple
from urllib.parse import urlencode
Expand Down Expand Up @@ -216,6 +217,24 @@ def build_default_dataset_id(evaluator_id: str) -> str:
def build_default_output_model(evaluator_id: str) -> str:
base = evaluator_id.lower().replace("_", "-")
uuid_suffix = str(uuid.uuid4())[:4]

# suffix is "-rft-{4chars}" -> 9 chars
suffix_len = 9
max_len = 63

# Check if we need to truncate
if len(base) + suffix_len > max_len:
# Calculate hash of the full base to preserve uniqueness
hash_digest = hashlib.sha256(base.encode("utf-8")).hexdigest()[:6]
# New structure: {truncated_base}-{hash}-{uuid_suffix}
# Space needed for "-{hash}" is 1 + 6 = 7
hash_part_len = 7

allowed_base_len = max_len - suffix_len - hash_part_len
truncated_base = base[:allowed_base_len].strip("-")

return f"{truncated_base}-{hash_digest}-rft-{uuid_suffix}"

return f"{base}-rft-{uuid_suffix}"


Expand Down