Upload folder using huggingface_hub
Browse files
src/ui.py
CHANGED
|
@@ -320,6 +320,8 @@ def build_interface() -> gr.Blocks:
|
|
| 320 |
download_model_btn.click(
|
| 321 |
# Lock UI
|
| 322 |
fn=lambda: set_interactivity(False), outputs=action_buttons
|
|
|
|
|
|
|
| 323 |
).then(
|
| 324 |
# Reset previous outputs and show "Zipping..."
|
| 325 |
fn=lambda: [gr.update(value=None, visible=False), "⏳ Zipping model..."],
|
|
@@ -337,6 +339,10 @@ def build_interface() -> gr.Blocks:
|
|
| 337 |
).then(
|
| 338 |
# Unlock UI
|
| 339 |
fn=lambda: set_interactivity(True), outputs=action_buttons
|
|
|
|
|
|
|
|
|
|
|
|
|
| 340 |
)
|
| 341 |
|
| 342 |
# 6. Push to Hub
|
|
@@ -348,9 +354,19 @@ def build_interface() -> gr.Blocks:
|
|
| 348 |
)
|
| 349 |
|
| 350 |
push_to_hub_btn.click(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 351 |
fn=push_to_hub_wrapper,
|
| 352 |
inputs=[session_state, repo_name_input],
|
| 353 |
outputs=[push_status]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 354 |
)
|
| 355 |
|
| 356 |
with gr.Tab("📰 Live Ranked Feed"):
|
|
|
|
| 320 |
download_model_btn.click(
|
| 321 |
# Lock UI
|
| 322 |
fn=lambda: set_interactivity(False), outputs=action_buttons
|
| 323 |
+
).then(
|
| 324 |
+
fn=lambda: gr.update(interactive=False), outputs=push_to_hub_btn
|
| 325 |
).then(
|
| 326 |
# Reset previous outputs and show "Zipping..."
|
| 327 |
fn=lambda: [gr.update(value=None, visible=False), "⏳ Zipping model..."],
|
|
|
|
| 339 |
).then(
|
| 340 |
# Unlock UI
|
| 341 |
fn=lambda: set_interactivity(True), outputs=action_buttons
|
| 342 |
+
).then(
|
| 343 |
+
fn=update_hub_interactive,
|
| 344 |
+
inputs=[session_state, username_state],
|
| 345 |
+
outputs=[repo_name_input, push_to_hub_btn]
|
| 346 |
)
|
| 347 |
|
| 348 |
# 6. Push to Hub
|
|
|
|
| 354 |
)
|
| 355 |
|
| 356 |
push_to_hub_btn.click(
|
| 357 |
+
fn=lambda: set_interactivity(False), outputs=action_buttons
|
| 358 |
+
).then(
|
| 359 |
+
fn=lambda: gr.update(interactive=False), outputs=push_to_hub_btn
|
| 360 |
+
).then(
|
| 361 |
fn=push_to_hub_wrapper,
|
| 362 |
inputs=[session_state, repo_name_input],
|
| 363 |
outputs=[push_status]
|
| 364 |
+
).then(
|
| 365 |
+
fn=lambda: set_interactivity(True), outputs=action_buttons
|
| 366 |
+
).then(
|
| 367 |
+
fn=update_hub_interactive,
|
| 368 |
+
inputs=[session_state, username_state],
|
| 369 |
+
outputs=[repo_name_input, push_to_hub_btn]
|
| 370 |
)
|
| 371 |
|
| 372 |
with gr.Tab("📰 Live Ranked Feed"):
|