Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,6 @@ import gradio as gr
|
|
| 2 |
from huggingface_hub import create_repo, upload_file, whoami, Repository
|
| 3 |
import os
|
| 4 |
import shutil
|
| 5 |
-
import time
|
| 6 |
|
| 7 |
def duplicate(source_repo, dst_repo, token, repo_type, progress=gr.Progress()):
|
| 8 |
# Get username from token
|
|
@@ -93,8 +92,15 @@ def duplicate(source_repo, dst_repo, token, repo_type, progress=gr.Progress()):
|
|
| 93 |
"\n".join(logs)
|
| 94 |
)
|
| 95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
# Updated Gradio interface with progress panel
|
| 97 |
-
with gr.Blocks(title="Duplicate your repo!") as interface:
|
| 98 |
gr.Markdown("""
|
| 99 |
# Duplicate your repo!
|
| 100 |
Duplicate a Hugging Face repository! You need a write token from https://hf.co/settings/tokens.
|
|
@@ -132,8 +138,8 @@ with gr.Blocks(title="Duplicate your repo!") as interface:
|
|
| 132 |
gr.Markdown("### Overall Progress")
|
| 133 |
global_progress = gr.Progress()
|
| 134 |
gr.Markdown("### File Progress")
|
| 135 |
-
with gr.Column(variant="panel"):
|
| 136 |
-
file_progress = gr.Progress(
|
| 137 |
log_output = gr.Textbox(label="Progress Log", lines=10)
|
| 138 |
|
| 139 |
gr.Markdown("""
|
|
|
|
| 2 |
from huggingface_hub import create_repo, upload_file, whoami, Repository
|
| 3 |
import os
|
| 4 |
import shutil
|
|
|
|
| 5 |
|
| 6 |
def duplicate(source_repo, dst_repo, token, repo_type, progress=gr.Progress()):
|
| 7 |
# Get username from token
|
|
|
|
| 92 |
"\n".join(logs)
|
| 93 |
)
|
| 94 |
|
| 95 |
+
# Custom CSS for yellow progress bars
|
| 96 |
+
css = """
|
| 97 |
+
.progress-container:nth-child(4) .progress-bar {
|
| 98 |
+
background-color: yellow !important;
|
| 99 |
+
}
|
| 100 |
+
"""
|
| 101 |
+
|
| 102 |
# Updated Gradio interface with progress panel
|
| 103 |
+
with gr.Blocks(title="Duplicate your repo!", css=css) as interface:
|
| 104 |
gr.Markdown("""
|
| 105 |
# Duplicate your repo!
|
| 106 |
Duplicate a Hugging Face repository! You need a write token from https://hf.co/settings/tokens.
|
|
|
|
| 138 |
gr.Markdown("### Overall Progress")
|
| 139 |
global_progress = gr.Progress()
|
| 140 |
gr.Markdown("### File Progress")
|
| 141 |
+
with gr.Column(variant="panel", elem_classes="progress-container"):
|
| 142 |
+
file_progress = gr.Progress()
|
| 143 |
log_output = gr.Textbox(label="Progress Log", lines=10)
|
| 144 |
|
| 145 |
gr.Markdown("""
|