Spaces:
Paused
Paused
Update password form
Browse files
app.py
CHANGED
@@ -436,8 +436,12 @@ css = r"""
|
|
436 |
|
437 |
def check_password(password: str) -> bool:
|
438 |
if password == PASSWORD:
|
439 |
-
return [
|
440 |
-
|
|
|
|
|
|
|
|
|
441 |
|
442 |
|
443 |
with gr.Blocks(css=css) as demo:
|
@@ -576,13 +580,30 @@ with gr.Blocks(css=css) as demo:
|
|
576 |
value=20,
|
577 |
)
|
578 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
579 |
with gr.Row():
|
580 |
password = gr.Textbox(label="Password", type="password")
|
581 |
submit = gr.Button("Submit")
|
582 |
submit.click(
|
583 |
fn=check_password,
|
584 |
-
inputs=[password],
|
585 |
-
outputs=[submit, content],
|
586 |
)
|
587 |
|
588 |
# This needs to be called at some point prior to the first call to callback.flag()
|
@@ -595,23 +616,6 @@ with gr.Blocks(css=css) as demo:
|
|
595 |
"examples_dataset",
|
596 |
)
|
597 |
|
598 |
-
with gr.Column(elem_id="col-showcase"):
|
599 |
-
gr.HTML("""
|
600 |
-
<div style="display: flex; justify-content: center; align-items: center; text-align: center; font-size: 20px;">
|
601 |
-
<div> </div>
|
602 |
-
<br>
|
603 |
-
<div>
|
604 |
-
AnyFurnish examples in pairs of furniture and room images
|
605 |
-
</div>
|
606 |
-
</div>
|
607 |
-
""")
|
608 |
-
show_case = gr.Examples(
|
609 |
-
examples=list(EXAMPLES.values()),
|
610 |
-
inputs=[furniture_image_input, room_image_input, results],
|
611 |
-
label="Examples",
|
612 |
-
examples_per_page=12,
|
613 |
-
)
|
614 |
-
|
615 |
|
616 |
# demo.launch(auth=[(USER, PASSWORD)])
|
617 |
demo.launch()
|
|
|
436 |
|
437 |
def check_password(password: str) -> bool:
|
438 |
if password == PASSWORD:
|
439 |
+
return [
|
440 |
+
gr.update(visible=False),
|
441 |
+
gr.update(visible=False),
|
442 |
+
gr.update(visible=True),
|
443 |
+
]
|
444 |
+
return [gr.update(visible=True), gr.update(visible=True), gr.update(visible=False)]
|
445 |
|
446 |
|
447 |
with gr.Blocks(css=css) as demo:
|
|
|
580 |
value=20,
|
581 |
)
|
582 |
|
583 |
+
with gr.Column(elem_id="col-showcase"):
|
584 |
+
gr.HTML("""
|
585 |
+
<div style="display: flex; justify-content: center; align-items: center; text-align: center; font-size: 20px;">
|
586 |
+
<div> </div>
|
587 |
+
<br>
|
588 |
+
<div>
|
589 |
+
AnyFurnish examples in pairs of furniture and room images
|
590 |
+
</div>
|
591 |
+
</div>
|
592 |
+
""")
|
593 |
+
show_case = gr.Examples(
|
594 |
+
examples=list(EXAMPLES.values()),
|
595 |
+
inputs=[furniture_image_input, room_image_input, results],
|
596 |
+
label="Examples",
|
597 |
+
examples_per_page=12,
|
598 |
+
)
|
599 |
+
|
600 |
with gr.Row():
|
601 |
password = gr.Textbox(label="Password", type="password")
|
602 |
submit = gr.Button("Submit")
|
603 |
submit.click(
|
604 |
fn=check_password,
|
605 |
+
inputs=[password, submit],
|
606 |
+
outputs=[password, submit, content],
|
607 |
)
|
608 |
|
609 |
# This needs to be called at some point prior to the first call to callback.flag()
|
|
|
616 |
"examples_dataset",
|
617 |
)
|
618 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
619 |
|
620 |
# demo.launch(auth=[(USER, PASSWORD)])
|
621 |
demo.launch()
|