Spaces:
Running
on
Zero
Running
on
Zero
Joffrey Thomas
commited on
Commit
·
d114ce7
1
Parent(s):
8e91d04
logout + better image
Browse files
app.py
CHANGED
|
@@ -11,7 +11,6 @@ import requests
|
|
| 11 |
from dotenv import load_dotenv
|
| 12 |
import gradio as gr
|
| 13 |
from gradio.components import LoginButton
|
| 14 |
-
from gradio import LogoutButton
|
| 15 |
|
| 16 |
import data_manager
|
| 17 |
|
|
@@ -716,7 +715,6 @@ with gr.Blocks(css=APP_CSS, title="LLM GeoGuessr") as demo:
|
|
| 716 |
login_button = LoginButton(visible=True)
|
| 717 |
|
| 718 |
logged_in_md = gr.Markdown(visible=False)
|
| 719 |
-
logout_button = LogoutButton(visible=False)
|
| 720 |
|
| 721 |
with gr.Group(visible=False, elem_id="lobby_group") as lobby_group:
|
| 722 |
start_btn = gr.Button("Start Game", variant="primary", elem_id="start_btn")
|
|
@@ -745,7 +743,6 @@ with gr.Blocks(css=APP_CSS, title="LLM GeoGuessr") as demo:
|
|
| 745 |
gr.update(visible=True),
|
| 746 |
gr.update(visible=False),
|
| 747 |
gr.update(visible=False),
|
| 748 |
-
gr.update(visible=False),
|
| 749 |
gr.update(),
|
| 750 |
gr.update(visible=False),
|
| 751 |
)
|
|
@@ -763,7 +760,6 @@ with gr.Blocks(css=APP_CSS, title="LLM GeoGuessr") as demo:
|
|
| 763 |
gr.update(visible=True),
|
| 764 |
gr.update(visible=False),
|
| 765 |
gr.update(visible=False),
|
| 766 |
-
gr.update(visible=False),
|
| 767 |
gr.update(),
|
| 768 |
gr.update(visible=False),
|
| 769 |
)
|
|
@@ -773,9 +769,8 @@ with gr.Blocks(css=APP_CSS, title="LLM GeoGuessr") as demo:
|
|
| 773 |
updates = [
|
| 774 |
profile,
|
| 775 |
gr.update(visible=False),
|
| 776 |
-
gr.update(visible=False),
|
| 777 |
-
gr.update(visible=True, value=welcome_message),
|
| 778 |
gr.update(visible=True),
|
|
|
|
| 779 |
gr.update(visible=True),
|
| 780 |
]
|
| 781 |
|
|
@@ -802,7 +797,6 @@ with gr.Blocks(css=APP_CSS, title="LLM GeoGuessr") as demo:
|
|
| 802 |
login_prompt_md,
|
| 803 |
login_button,
|
| 804 |
logged_in_md,
|
| 805 |
-
logout_button,
|
| 806 |
lobby_group,
|
| 807 |
start_btn,
|
| 808 |
limit_msg,
|
|
@@ -817,22 +811,6 @@ with gr.Blocks(css=APP_CSS, title="LLM GeoGuessr") as demo:
|
|
| 817 |
login_prompt_md,
|
| 818 |
login_button,
|
| 819 |
logged_in_md,
|
| 820 |
-
logout_button,
|
| 821 |
-
lobby_group,
|
| 822 |
-
start_btn,
|
| 823 |
-
limit_msg,
|
| 824 |
-
],
|
| 825 |
-
)
|
| 826 |
-
|
| 827 |
-
# Handle logout
|
| 828 |
-
logout_button.click(
|
| 829 |
-
on_login,
|
| 830 |
-
outputs=[
|
| 831 |
-
user_profile,
|
| 832 |
-
login_prompt_md,
|
| 833 |
-
login_button,
|
| 834 |
-
logged_in_md,
|
| 835 |
-
logout_button,
|
| 836 |
lobby_group,
|
| 837 |
start_btn,
|
| 838 |
limit_msg,
|
|
|
|
| 11 |
from dotenv import load_dotenv
|
| 12 |
import gradio as gr
|
| 13 |
from gradio.components import LoginButton
|
|
|
|
| 14 |
|
| 15 |
import data_manager
|
| 16 |
|
|
|
|
| 715 |
login_button = LoginButton(visible=True)
|
| 716 |
|
| 717 |
logged_in_md = gr.Markdown(visible=False)
|
|
|
|
| 718 |
|
| 719 |
with gr.Group(visible=False, elem_id="lobby_group") as lobby_group:
|
| 720 |
start_btn = gr.Button("Start Game", variant="primary", elem_id="start_btn")
|
|
|
|
| 743 |
gr.update(visible=True),
|
| 744 |
gr.update(visible=False),
|
| 745 |
gr.update(visible=False),
|
|
|
|
| 746 |
gr.update(),
|
| 747 |
gr.update(visible=False),
|
| 748 |
)
|
|
|
|
| 760 |
gr.update(visible=True),
|
| 761 |
gr.update(visible=False),
|
| 762 |
gr.update(visible=False),
|
|
|
|
| 763 |
gr.update(),
|
| 764 |
gr.update(visible=False),
|
| 765 |
)
|
|
|
|
| 769 |
updates = [
|
| 770 |
profile,
|
| 771 |
gr.update(visible=False),
|
|
|
|
|
|
|
| 772 |
gr.update(visible=True),
|
| 773 |
+
gr.update(visible=True, value=welcome_message),
|
| 774 |
gr.update(visible=True),
|
| 775 |
]
|
| 776 |
|
|
|
|
| 797 |
login_prompt_md,
|
| 798 |
login_button,
|
| 799 |
logged_in_md,
|
|
|
|
| 800 |
lobby_group,
|
| 801 |
start_btn,
|
| 802 |
limit_msg,
|
|
|
|
| 811 |
login_prompt_md,
|
| 812 |
login_button,
|
| 813 |
logged_in_md,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 814 |
lobby_group,
|
| 815 |
start_btn,
|
| 816 |
limit_msg,
|