Skip to content

Commit e98c325

Browse files
committed
update engine path processing
Signed-off-by: ajrasane <[email protected]>
1 parent 37c6250 commit e98c325

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modelopt/torch/_deploy/_runtime/tensorrt/engine_builder.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,11 @@ def _setup_files_and_paths(
213213
final_output_dir = Path(output_dir or Path(gettempdir()) / DEFAULT_ARTIFACT_DIR)
214214
final_output_dir.mkdir(parents=True, exist_ok=True)
215215
engine_path = (
216-
engine_path if engine_path else final_output_dir / f"{onnx_bytes.model_name}.engine"
216+
Path(engine_path)
217+
if engine_path
218+
else final_output_dir / f"{onnx_bytes.model_name}.engine"
217219
)
220+
engine_path.parent.mkdir(parents=True, exist_ok=True)
218221
calib_cache_path = final_output_dir / "calib_cache" if calib_cache else None
219222
timing_cache_path = final_output_dir / "timing.cache"
220223

0 commit comments

Comments
 (0)