Expose safety guard in Modal eval
Browse filesCo-authored-by: Codex <codex@openai.com>
- training/modal_eval.py +5 -0
training/modal_eval.py
CHANGED
|
@@ -40,6 +40,7 @@ def run_eval(
|
|
| 40 |
adapter_id: str | None = "build-small-hackathon/jawbreaker-minicpm-lora",
|
| 41 |
limit: int | None = None,
|
| 42 |
output_prefix: str = "jawbreaker-minicpm-lora-generated",
|
|
|
|
| 43 |
) -> None:
|
| 44 |
import os
|
| 45 |
import subprocess
|
|
@@ -67,6 +68,8 @@ def run_eval(
|
|
| 67 |
cmd.extend(["--adapter-id", adapter_id])
|
| 68 |
if limit:
|
| 69 |
cmd.extend(["--limit", str(limit)])
|
|
|
|
|
|
|
| 70 |
|
| 71 |
print("jawbreaker modal_eval command=" + " ".join(cmd), flush=True)
|
| 72 |
subprocess.run(cmd, check=True)
|
|
@@ -82,6 +85,7 @@ def main(
|
|
| 82 |
adapter_id: str | None = "build-small-hackathon/jawbreaker-minicpm-lora",
|
| 83 |
limit: int | None = None,
|
| 84 |
output_prefix: str = "jawbreaker-minicpm-lora-generated",
|
|
|
|
| 85 |
) -> None:
|
| 86 |
run_eval.remote(
|
| 87 |
dataset=dataset,
|
|
@@ -89,4 +93,5 @@ def main(
|
|
| 89 |
adapter_id=adapter_id,
|
| 90 |
limit=limit,
|
| 91 |
output_prefix=output_prefix,
|
|
|
|
| 92 |
)
|
|
|
|
| 40 |
adapter_id: str | None = "build-small-hackathon/jawbreaker-minicpm-lora",
|
| 41 |
limit: int | None = None,
|
| 42 |
output_prefix: str = "jawbreaker-minicpm-lora-generated",
|
| 43 |
+
apply_safety_guard: bool = False,
|
| 44 |
) -> None:
|
| 45 |
import os
|
| 46 |
import subprocess
|
|
|
|
| 68 |
cmd.extend(["--adapter-id", adapter_id])
|
| 69 |
if limit:
|
| 70 |
cmd.extend(["--limit", str(limit)])
|
| 71 |
+
if apply_safety_guard:
|
| 72 |
+
cmd.append("--apply-safety-guard")
|
| 73 |
|
| 74 |
print("jawbreaker modal_eval command=" + " ".join(cmd), flush=True)
|
| 75 |
subprocess.run(cmd, check=True)
|
|
|
|
| 85 |
adapter_id: str | None = "build-small-hackathon/jawbreaker-minicpm-lora",
|
| 86 |
limit: int | None = None,
|
| 87 |
output_prefix: str = "jawbreaker-minicpm-lora-generated",
|
| 88 |
+
apply_safety_guard: bool = False,
|
| 89 |
) -> None:
|
| 90 |
run_eval.remote(
|
| 91 |
dataset=dataset,
|
|
|
|
| 93 |
adapter_id=adapter_id,
|
| 94 |
limit=limit,
|
| 95 |
output_prefix=output_prefix,
|
| 96 |
+
apply_safety_guard=apply_safety_guard,
|
| 97 |
)
|