Skip to content

Commit 5885acd

Browse files
author
Ronald Tse
committed
fix: string precisions for Modal entrypoints (list[str] unparseable)
1 parent cde6807 commit 5885acd

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎src/gpu/modal_export.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def _load_pairs(path: Path) -> list[tuple[str, str]]:
199199
timeout=2 * 3600,
200200
volumes={**CHECKPOINT_VOLUMES, **DATASET_VOLUMES, "/outputs": MODELS_VOLUME},
201201
)
202-
def export_model(model_id: str, precisions: list[str]) -> dict[str, str]:
202+
def export_model(model_id: str, precisions: str = "fp32,fp16,int8") -> dict[str, str]:
203203
import sys
204204

205205
sys.path.insert(0, "/root/interscript-ml/src")
@@ -219,7 +219,7 @@ def export_model(model_id: str, precisions: list[str]) -> dict[str, str]:
219219
metadata_path,
220220
readme_path.read_text(encoding="utf-8"),
221221
out_dir,
222-
precisions=tuple(precisions),
222+
precisions=tuple(p.strip() for p in precisions.split(",") if p.strip()),
223223
)
224224
MODELS_VOLUME.commit()
225225

@@ -254,7 +254,9 @@ def export_model(model_id: str, precisions: list[str]) -> dict[str, str]:
254254
timeout=5 * 3600,
255255
volumes={**CHECKPOINT_VOLUMES, **DATASET_VOLUMES, "/outputs": MODELS_VOLUME},
256256
)
257-
def parity_model(model_id: str, precisions: list[str], limit: int = 0) -> dict[str, str]:
257+
def parity_model(
258+
model_id: str, precisions: str = "fp32,fp16,int8", limit: int = 0
259+
) -> dict[str, str]:
258260
"""WO03 gate on Modal: torch reference vs ONNX decode over the test
259261
split; writes the parity block into each zip (strict gate enforced)."""
260262
import sys

0 commit comments

Comments
 (0)