Spaces:
Running
Running
update
Browse files
app.py
CHANGED
|
@@ -8106,7 +8106,7 @@ with gr.Blocks(
|
|
| 8106 |
placeholder="https://huggingface.co/spaces/user/space OR https://huggingface.co/user/model OR https://github.com/owner/repo",
|
| 8107 |
lines=1
|
| 8108 |
, visible=False)
|
| 8109 |
-
load_project_btn = gr.Button("Import Project", variant="secondary", size="sm", visible=
|
| 8110 |
load_project_status = gr.Markdown(visible=False)
|
| 8111 |
|
| 8112 |
input = gr.Textbox(
|
|
@@ -8731,8 +8731,17 @@ with gr.Blocks(
|
|
| 8731 |
def hide_deploy_components(*args):
|
| 8732 |
return gr.Button(visible=True)
|
| 8733 |
|
| 8734 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8735 |
load_project_btn.click(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8736 |
handle_import_project,
|
| 8737 |
inputs=[load_project_url],
|
| 8738 |
outputs=[
|
|
|
|
| 8106 |
placeholder="https://huggingface.co/spaces/user/space OR https://huggingface.co/user/model OR https://github.com/owner/repo",
|
| 8107 |
lines=1
|
| 8108 |
, visible=False)
|
| 8109 |
+
load_project_btn = gr.Button("📥 Import Project", variant="secondary", size="sm", visible=True)
|
| 8110 |
load_project_status = gr.Markdown(visible=False)
|
| 8111 |
|
| 8112 |
input = gr.Textbox(
|
|
|
|
| 8731 |
def hide_deploy_components(*args):
|
| 8732 |
return gr.Button(visible=True)
|
| 8733 |
|
| 8734 |
+
# Show textbox when import button is clicked
|
| 8735 |
+
def toggle_import_textbox(url_visible):
|
| 8736 |
+
# If textbox is already visible and has content, proceed with import
|
| 8737 |
+
# Otherwise, just show the textbox
|
| 8738 |
+
return gr.update(visible=True)
|
| 8739 |
+
|
| 8740 |
load_project_btn.click(
|
| 8741 |
+
fn=toggle_import_textbox,
|
| 8742 |
+
inputs=[load_project_url],
|
| 8743 |
+
outputs=[load_project_url]
|
| 8744 |
+
).then(
|
| 8745 |
handle_import_project,
|
| 8746 |
inputs=[load_project_url],
|
| 8747 |
outputs=[
|