diff --git a/backends/apple/coreml/compiler/coreml_preprocess.py b/backends/apple/coreml/compiler/coreml_preprocess.py index d1614f30451..16ace2e7a88 100644 --- a/backends/apple/coreml/compiler/coreml_preprocess.py +++ b/backends/apple/coreml/compiler/coreml_preprocess.py @@ -6,6 +6,7 @@ import logging import shutil +import tempfile import uuid from dataclasses import asdict, dataclass from enum import Enum @@ -415,7 +416,7 @@ def preprocess_model( mlmodel: ct.models.MLModel, model_type: MODEL_TYPE ) -> PreprocessResult: identifier = "executorch_" + str(uuid.uuid4()) - dir_path: Path = Path("tmp") / identifier + dir_path: Path = Path(tempfile.gettempdir()) / identifier model_dir_path: Path = dir_path / "lowered_module" model_spec: ct.proto.Model_pb2 = mlmodel.get_spec() logger.warning(