Commit
·
95c5fdf
1
Parent(s):
cf0292d
Update app.py
Browse files
app.py
CHANGED
@@ -38,12 +38,13 @@ def duplicate(source_repo, dst_repo, token, repo_type):
|
|
38 |
if repo_type == "model":
|
39 |
repo_type = None
|
40 |
for f in files:
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
|
|
47 |
|
48 |
|
49 |
# Clean up to be nice with the environment
|
|
|
38 |
if repo_type == "model":
|
39 |
repo_type = None
|
40 |
for f in files:
|
41 |
+
if not f.startswith("."):
|
42 |
+
directories_list = root.split("/")
|
43 |
+
path_in_repo = "/".join(directories_list[1:])
|
44 |
+
if path_in_repo:
|
45 |
+
upload_file(os.path.join("hub", path_in_repo, f), f, dst_repo, token=token, repo_type=repo_type, path_in_repo=path_in_repo)
|
46 |
+
else:
|
47 |
+
upload_file(os.path.join("hub", path_in_repo, f), f, dst_repo, token=token, repo_type=repo_type)
|
48 |
|
49 |
|
50 |
# Clean up to be nice with the environment
|