@@ -106,13 +106,14 @@ class Fetcher {
106
106
/*
107
107
Fetching model and tokenizer file
108
108
1. Extract file name from provided URL
109
- 2. Check if the file has a valid extension
109
+ 2. If file name contains / it means that the file is local and we should return the path
110
+ 3. Check if the file has a valid extension
110
111
a. For tokenizer, the extension should be .bin
111
112
b. For model, the extension should be .pte
112
- 3 . Check if models directory exists, if not create it
113
- 4 . Check if the file already exists in the models directory, if yes return the path
114
- 5 . If the file does not exist, and is a tokenizer, fetch the file
115
- 6 . If the file is a model, fetch the file with ProgressResponseBody
113
+ 4 . Check if models directory exists, if not create it
114
+ 5 . Check if the file already exists in the models directory, if yes return the path
115
+ 6 . If the file does not exist, and is a tokenizer, fetch the file
116
+ 7 . If the file is a model, fetch the file with ProgressResponseBody
116
117
*/
117
118
val fileName: String
118
119
@@ -123,6 +124,11 @@ class Fetcher {
123
124
return
124
125
}
125
126
127
+ if (fileName.contains(" /" )){
128
+ onComplete(fileName, null )
129
+ return
130
+ }
131
+
126
132
if (! hasValidExtension(fileName, resourceType)) {
127
133
onComplete(null , Exception (" invalid_resource_extension" ))
128
134
return
0 commit comments