local copy

This commit is contained in:
Josh Yan
2024-07-05 15:05:58 -07:00
parent 154b59c0b6
commit c44f4825c4
5 changed files with 112 additions and 14 deletions

View File

@@ -316,7 +316,12 @@ func createBlob(cmd *cobra.Command, client *api.Client, path string) (string, er
}
if err == nil {
err = createBlobLocal(path, dest)
err = localCopy(path, dest)
if err == nil {
return digest, nil
}
err = defaultCopy(path, dest)
if err == nil {
return digest, nil
}
@@ -374,7 +379,7 @@ func getLocalPath(ctx context.Context, digest string) (string, error) {
return "", ErrBlobExists
}
func createBlobLocal(path string, dest string) error {
func defaultCopy(path string, dest string) error {
// This function should be called if the server is local
// It should find the model directory, copy the blob over, and return the digest
dirPath := filepath.Dir(dest)