You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Handles lifecycle of ML models on device: downloading, importing, validating, listing, and deleting. Supports single-file models and zip-based multi-file models with dependency validation.
3
+
Handles lifecycle of ML models on device: download, import, validation, listing, deletion, and model instantiation.
8
4
9
5
---
10
6
11
7
## ROOT_DIR
12
8
13
-
Base directory for all stored models.
14
-
15
-
*`"models"` inside `context.filesDir`
9
+
`filesDir/models/`
16
10
17
11
---
18
12
@@ -28,26 +22,10 @@ suspend fun downloadModelInternal(
28
22
29
23
Downloads a model into internal storage.
30
24
31
-
### Behavior
32
-
33
-
* Resolves target path via `getModelFile`
34
-
* Detects zip models via `resourceFiles`
35
-
36
-
### Zip flow
37
-
38
-
* Downloads to temporary `.zip`
39
-
* Extracts into target directory
40
-
* Validates required files exist
41
-
* Deletes extracted files on validation failure
42
-
43
-
### Single-file flow
44
-
45
-
* Direct download into target file
46
-
47
-
### Notes
48
-
49
-
* Progress reported 0–100 on main thread
50
-
* Uses temp file then atomic rename
25
+
* Streams file from network to local storage
26
+
* Reports progress (0–100) if available
27
+
* Uses temporary file then atomic rename
28
+
* Returns final model file
51
29
52
30
---
53
31
@@ -57,7 +35,7 @@ Downloads a model into internal storage.
0 commit comments