Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import os
|
|
| 6 |
token = os.getenv("Key")
|
| 7 |
|
| 8 |
|
| 9 |
-
def upload_file_to_hub(file_path, repo_id, path_in_repo,
|
| 10 |
"""
|
| 11 |
Upload a single file to Hugging Face Hub
|
| 12 |
"""
|
|
@@ -33,7 +33,7 @@ def upload_file_to_hub(file_path, repo_id, path_in_repo, token, repo_type, commi
|
|
| 33 |
except Exception as e:
|
| 34 |
return f"❌ Error uploading file: {str(e)}"
|
| 35 |
|
| 36 |
-
def upload_folder_to_hub(folder_path, repo_id, folder_path_in_repo,
|
| 37 |
"""
|
| 38 |
Upload a folder to Hugging Face Hub
|
| 39 |
"""
|
|
@@ -125,7 +125,7 @@ with gr.Blocks(title="Hugging Face Hub Uploader", theme=gr.themes.Soft()) as dem
|
|
| 125 |
|
| 126 |
upload_file_btn.click(
|
| 127 |
fn=upload_file_to_hub,
|
| 128 |
-
inputs=[file_input, repo_id_file, path_in_repo_file,
|
| 129 |
outputs=file_output
|
| 130 |
)
|
| 131 |
|
|
@@ -174,7 +174,7 @@ with gr.Blocks(title="Hugging Face Hub Uploader", theme=gr.themes.Soft()) as dem
|
|
| 174 |
|
| 175 |
upload_folder_btn.click(
|
| 176 |
fn=upload_folder_to_hub,
|
| 177 |
-
inputs=[folder_input, repo_id_folder, folder_path_in_repo,
|
| 178 |
outputs=folder_output
|
| 179 |
)
|
| 180 |
|
|
|
|
| 6 |
token = os.getenv("Key")
|
| 7 |
|
| 8 |
|
| 9 |
+
def upload_file_to_hub(file_path, repo_id, path_in_repo, repo_type, commit_message):
|
| 10 |
"""
|
| 11 |
Upload a single file to Hugging Face Hub
|
| 12 |
"""
|
|
|
|
| 33 |
except Exception as e:
|
| 34 |
return f"❌ Error uploading file: {str(e)}"
|
| 35 |
|
| 36 |
+
def upload_folder_to_hub(folder_path, repo_id, folder_path_in_repo, repo_type, commit_message, ignore_patterns):
|
| 37 |
"""
|
| 38 |
Upload a folder to Hugging Face Hub
|
| 39 |
"""
|
|
|
|
| 125 |
|
| 126 |
upload_file_btn.click(
|
| 127 |
fn=upload_file_to_hub,
|
| 128 |
+
inputs=[file_input, repo_id_file, path_in_repo_file, repo_type_file, commit_message_file],
|
| 129 |
outputs=file_output
|
| 130 |
)
|
| 131 |
|
|
|
|
| 174 |
|
| 175 |
upload_folder_btn.click(
|
| 176 |
fn=upload_folder_to_hub,
|
| 177 |
+
inputs=[folder_input, repo_id_folder, folder_path_in_repo, repo_type_folder, commit_message_folder, ignore_patterns],
|
| 178 |
outputs=folder_output
|
| 179 |
)
|
| 180 |
|