Skip to content

Commit 36fb4a9

Browse files
authored
Local path support for onnx (#1009)
1 parent e8edbcc commit 36fb4a9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cli/local/model_cache.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ func CacheModel(modelPath string, awsClient *aws.Client) (*spec.LocalModelCache,
7777
if err != nil {
7878
return nil, err
7979
}
80+
} else if strings.HasSuffix(modelPath, ".onnx") {
81+
fmt.Println(fmt.Sprintf("caching model %s ...", modelPath))
82+
err := files.CopyFileOverwrite(modelPath, filepath.Join(modelDir, filepath.Base(modelPath)))
83+
if err != nil {
84+
return nil, err
85+
}
8086
} else {
8187
fmt.Println(fmt.Sprintf("caching model %s ...", modelPath))
8288
err := files.CopyDirOverwrite(strings.TrimSuffix(modelPath, "/"), s.EnsureSuffix(modelDir, "/"))

0 commit comments

Comments
 (0)