Spaces:
Sleeping
Sleeping
Search commited on
Commit ·
fa62175
1
Parent(s): c4cddd0
auto: sync run_qwen_motif_protocol.py
Browse files
scripts/run_qwen_motif_protocol.py
CHANGED
|
@@ -71,6 +71,19 @@ def parse_optional_split_kinds(text: str | None) -> tuple[str, ...] | None:
|
|
| 71 |
return tuple(values)
|
| 72 |
|
| 73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
def resolve_device(device_arg: str) -> str:
|
| 75 |
if device_arg != "auto":
|
| 76 |
return device_arg
|
|
@@ -769,7 +782,15 @@ def build_arg_parser() -> argparse.ArgumentParser:
|
|
| 769 |
parser.add_argument("--seed_base", "--seed-base", dest="seed_base", type=int, default=0)
|
| 770 |
parser.add_argument("--seeds", default=None)
|
| 771 |
parser.add_argument("--split_kinds", "--split-kinds", dest="split_kinds", default=None)
|
| 772 |
-
parser.add_argument(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 773 |
parser.add_argument("--output_json", "--output-json", dest="output_json", type=Path, default=ROOT / "archive" / "qwen_motif_protocol.json")
|
| 774 |
return parser
|
| 775 |
|
|
|
|
| 71 |
return tuple(values)
|
| 72 |
|
| 73 |
|
| 74 |
+
def parse_bool_flag(value: str | bool | None) -> bool:
|
| 75 |
+
if value is None:
|
| 76 |
+
return True
|
| 77 |
+
if isinstance(value, bool):
|
| 78 |
+
return value
|
| 79 |
+
normalized = str(value).strip().lower()
|
| 80 |
+
if normalized in {"1", "true", "yes", "y", "on"}:
|
| 81 |
+
return True
|
| 82 |
+
if normalized in {"0", "false", "no", "n", "off"}:
|
| 83 |
+
return False
|
| 84 |
+
raise argparse.ArgumentTypeError(f"invalid boolean flag value: {value}")
|
| 85 |
+
|
| 86 |
+
|
| 87 |
def resolve_device(device_arg: str) -> str:
|
| 88 |
if device_arg != "auto":
|
| 89 |
return device_arg
|
|
|
|
| 782 |
parser.add_argument("--seed_base", "--seed-base", dest="seed_base", type=int, default=0)
|
| 783 |
parser.add_argument("--seeds", default=None)
|
| 784 |
parser.add_argument("--split_kinds", "--split-kinds", dest="split_kinds", default=None)
|
| 785 |
+
parser.add_argument(
|
| 786 |
+
"--skip_dense_baseline",
|
| 787 |
+
"--skip-dense-baseline",
|
| 788 |
+
dest="skip_dense_baseline",
|
| 789 |
+
nargs="?",
|
| 790 |
+
const=True,
|
| 791 |
+
default=False,
|
| 792 |
+
type=parse_bool_flag,
|
| 793 |
+
)
|
| 794 |
parser.add_argument("--output_json", "--output-json", dest="output_json", type=Path, default=ROOT / "archive" / "qwen_motif_protocol.json")
|
| 795 |
return parser
|
| 796 |
|