Linaqruf commited on
Commit
d0141ad
·
verified ·
1 Parent(s): 92609ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -137,9 +137,18 @@ class MigrationTool:
137
  chinese_name=chinese_name,
138
  token=token,
139
  )
140
- except Exception as create_error:
141
  # Repository might already exist, continue to push
142
- pass
 
 
 
 
 
 
 
 
 
143
 
144
  # Push the model/dataset
145
  if repo_type == "model":
 
137
  chinese_name=chinese_name,
138
  token=token,
139
  )
140
+ except Exception:
141
  # Repository might already exist, continue to push
142
+ # We update the visibility explicitly to ensure it matches user choice
143
+ try:
144
+ api.set_repo_visibility(
145
+ repo_id=repo_id,
146
+ repo_type=repo_type,
147
+ visibility=visibility, # "public" or "private"
148
+ token=token
149
+ )
150
+ except Exception as vis_error:
151
+ print(f"Warning: Failed to update visibility: {vis_error}")
152
 
153
  # Push the model/dataset
154
  if repo_type == "model":