(model_path: Path, params: dict[str, Any])
| 933 | |
| 934 | |
| 935 | def _build_export_script(model_path: Path, params: dict[str, Any]) -> str: |
| 936 | return "\n".join( |
| 937 | [ |
| 938 | "from ultralytics import YOLO", |
| 939 | "", |
| 940 | "if __name__ == '__main__':", |
| 941 | f" exported = YOLO({str(model_path)!r}).export(**{params!r})", |
| 942 | " print(f'Exported path: {exported}', flush=True)", |
| 943 | ] |
| 944 | ) |
| 945 | |
| 946 | |
| 947 | def _stream_export(payload: ExportRequest, model_path: Path): |