File tree Expand file tree Collapse file tree 3 files changed +4
-8
lines changed
examples/apple/coreml/scripts Expand file tree Collapse file tree 3 files changed +4
-8
lines changed Original file line number Diff line number Diff line change 1616
1717import coremltools as ct
1818import coremltools .optimize as cto
19- import executorchcoreml
2019
20+ from executorch .backends .apple .coreml import inmemoryfs
2121from executorch .exir .backend .backend_details import (
2222 BackendDetails ,
2323 ExportedProgram ,
@@ -385,8 +385,7 @@ def preprocess_model(
385385 )
386386
387387 processed_bytes : bytes = (
388- executorchcoreml .flatten_directory_contents (str (model_dir_path .resolve ()))
389- or b""
388+ inmemoryfs .flatten_directory_contents (str (model_dir_path .resolve ())) or b""
390389 )
391390
392391 debug_handle_map : Optional [Dict [str , Tuple [int ]]] = None
File renamed without changes.
Original file line number Diff line number Diff line change 1010
1111from typing import List , Optional
1212
13- import executorchcoreml
14-
13+ from executorch .backends .apple .coreml import inmemoryfs
1514from executorch .backends .apple .coreml .compiler import CoreMLBackend
16-
1715from executorch .exir ._serialize ._program import deserialize_pte_binary
18-
1916from executorch .exir .schema import (
2017 BackendDelegate ,
2118 BackendDelegateDataReference ,
@@ -50,7 +47,7 @@ def extract_coreml_models(pte_data: bytes):
5047 shutil .rmtree (model_path .absolute ())
5148 os .makedirs (model_path .absolute ())
5249
53- if executorchcoreml .unflatten_directory_contents (
50+ if inmemoryfs .unflatten_directory_contents (
5451 coreml_processed_bytes , str (model_path .absolute ())
5552 ):
5653 print (f"Core ML models are extracted and saved to path = { model_path } " )
You can’t perform that action at this time.
0 commit comments