Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,7 +30,7 @@ def fetch_files(source_repo, hf_token):
|
|
| 30 |
folder_path = "/".join(parts[:-1])
|
| 31 |
display = f"π {folder_path}/ βββ π {parts[-1]}"
|
| 32 |
|
| 33 |
-
# Gradio
|
| 34 |
choices.append((display, f))
|
| 35 |
|
| 36 |
yield (
|
|
@@ -67,8 +67,8 @@ def clone_repository(source_repo, target_repo, hf_token, selected_files, all_fil
|
|
| 67 |
if files_to_delete:
|
| 68 |
yield f"Status: Deleting {len(files_to_delete)} unselected files from '{target_repo}'..."
|
| 69 |
|
| 70 |
-
#
|
| 71 |
-
operations = [CommitOperationDelete(
|
| 72 |
|
| 73 |
# Execute deletion in a single commit natively on HF servers
|
| 74 |
api.create_commit(
|
|
@@ -84,8 +84,8 @@ def clone_repository(source_repo, target_repo, hf_token, selected_files, all_fil
|
|
| 84 |
yield f"An error occurred: {str(e)}"
|
| 85 |
|
| 86 |
|
| 87 |
-
#
|
| 88 |
-
with gr.Blocks(
|
| 89 |
gr.Markdown("# π Selective Hugging Face Model Cloner")
|
| 90 |
gr.Markdown("Fetch files from a model repository, uncheck what you don't need, and clone via high-speed server-side duplication.")
|
| 91 |
|
|
@@ -137,4 +137,5 @@ with gr.Blocks(theme=gr.themes.Soft(), title="Selective HF Model Cloner") as dem
|
|
| 137 |
)
|
| 138 |
|
| 139 |
if __name__ == "__main__":
|
| 140 |
-
|
|
|
|
|
|
| 30 |
folder_path = "/".join(parts[:-1])
|
| 31 |
display = f"π {folder_path}/ βββ π {parts[-1]}"
|
| 32 |
|
| 33 |
+
# Gradio allows (display_name, value) tuples for CheckboxGroup choices
|
| 34 |
choices.append((display, f))
|
| 35 |
|
| 36 |
yield (
|
|
|
|
| 67 |
if files_to_delete:
|
| 68 |
yield f"Status: Deleting {len(files_to_delete)} unselected files from '{target_repo}'..."
|
| 69 |
|
| 70 |
+
# Use 'path_in_repo' instead of 'path' to comply with the HF SDK
|
| 71 |
+
operations = [CommitOperationDelete(path_in_repo=f) for f in files_to_delete]
|
| 72 |
|
| 73 |
# Execute deletion in a single commit natively on HF servers
|
| 74 |
api.create_commit(
|
|
|
|
| 84 |
yield f"An error occurred: {str(e)}"
|
| 85 |
|
| 86 |
|
| 87 |
+
# Notice: The 'theme' parameter has been removed from Blocks to satisfy Gradio 6.0 specs
|
| 88 |
+
with gr.Blocks(title="Selective HF Model Cloner") as demo:
|
| 89 |
gr.Markdown("# π Selective Hugging Face Model Cloner")
|
| 90 |
gr.Markdown("Fetch files from a model repository, uncheck what you don't need, and clone via high-speed server-side duplication.")
|
| 91 |
|
|
|
|
| 137 |
)
|
| 138 |
|
| 139 |
if __name__ == "__main__":
|
| 140 |
+
# The theme parameter is now passed into launch() per Gradio 6.0 rules
|
| 141 |
+
demo.queue().launch(theme=gr.themes.Soft())
|