Skip to content

Commit 643b9b7

Browse files
committed
Fix push_to_hub when last-checkpoint (#1897)
(cherry picked from commit 9799026)
1 parent 0e4e9c3 commit 643b9b7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

swift/trainers/push_to_ms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ def upload_folder(
6464
if ignore_patterns:
6565
ignore_patterns = [p for p in ignore_patterns if p != '_*']
6666
if path_in_repo:
67-
idx = folder_path.rfind(path_in_repo)
68-
if idx >= 0:
69-
folder_path = folder_path[:idx]
67+
# We don't support part submit for now
68+
path_in_repo = os.path.basename(folder_path)
69+
folder_path = os.path.dirname(folder_path)
7070
ignore_patterns = []
7171
push_to_hub(
7272
repo_id,

0 commit comments

Comments
 (0)