Skip to content

Commit 27e2f0d

Browse files
YIWENX14facebook-github-bot
authored andcommitted
fix rmtree failure in coreml
Summary: Use actual temp directory instead of local folder "tmp/" to avoid rmtree failure. Differential Revision: D83371990
1 parent 684b5fd commit 27e2f0d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backends/apple/coreml/compiler/coreml_preprocess.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from enum import Enum
1212

1313
from pathlib import Path
14+
import tempfile
1415

1516
from typing import Any, Dict, final, List, Optional, Tuple
1617

@@ -415,7 +416,7 @@ def preprocess_model(
415416
mlmodel: ct.models.MLModel, model_type: MODEL_TYPE
416417
) -> PreprocessResult:
417418
identifier = "executorch_" + str(uuid.uuid4())
418-
dir_path: Path = Path("tmp") / identifier
419+
dir_path: Path = Path(tempfile.gettempdir()) / identifier
419420
model_dir_path: Path = dir_path / "lowered_module"
420421
model_spec: ct.proto.Model_pb2 = mlmodel.get_spec()
421422
logger.warning(

0 commit comments

Comments
 (0)