osanseviero commited on
Commit
95c5fdf
·
1 Parent(s): cf0292d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
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
- directories_list = root.split("/")
42
- path_in_repo = "/".join(directories_list[1:])
43
- if path_in_repo:
44
- upload_file(os.path.join(local_dir, path_in_repo, f), f, dst_repo, token=token, repo_type=repo_type, path_in_repo=path_in_repo)
45
- else:
46
- upload_file(os.path.join(local_dir, path_in_repo, f), f, dst_repo, token=token, repo_type=repo_type)
 
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