Update app.py
Browse files
app.py
CHANGED
|
@@ -421,9 +421,9 @@ def get_dropdown_choices(info_dict):
|
|
| 421 |
|
| 422 |
def login(username, password):
|
| 423 |
if username == USERNAME and password == PASSWORD:
|
| 424 |
-
return gr.update(visible=True), gr.update(visible=False), gr.update(visible=False), gr.update(value="Login successful! You can now access the Caption Captain tab.", visible=True
|
| 425 |
else:
|
| 426 |
-
return gr.update(visible=False), gr.update(visible=True), gr.update(visible=True), gr.update(value="Invalid username or password. Please try again.", visible=True
|
| 427 |
|
| 428 |
# Gradio interface
|
| 429 |
with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True) as demo:
|
|
@@ -462,9 +462,9 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
|
|
| 462 |
)
|
| 463 |
|
| 464 |
with gr.Row():
|
| 465 |
-
username = gr.Textbox(label="Username", placeholder="Enter your username")
|
| 466 |
with gr.Row():
|
| 467 |
-
password = gr.Textbox(label="Password", type="password", placeholder="Enter your password")
|
| 468 |
with gr.Row():
|
| 469 |
login_button = gr.Button("Login", size="sm")
|
| 470 |
login_message = gr.Markdown(visible=False)
|
|
|
|
| 421 |
|
| 422 |
def login(username, password):
|
| 423 |
if username == USERNAME and password == PASSWORD:
|
| 424 |
+
return gr.update(visible=True), gr.update(visible=False), gr.update(visible=False), gr.update(value="Login successful! You can now access the Caption Captain tab.", visible=True)
|
| 425 |
else:
|
| 426 |
+
return gr.update(visible=False), gr.update(visible=True), gr.update(visible=True), gr.update(value="Invalid username or password. Please try again.", visible=True)
|
| 427 |
|
| 428 |
# Gradio interface
|
| 429 |
with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True) as demo:
|
|
|
|
| 462 |
)
|
| 463 |
|
| 464 |
with gr.Row():
|
| 465 |
+
username = gr.Textbox(label="Username", placeholder="Enter your username", value="ugd")
|
| 466 |
with gr.Row():
|
| 467 |
+
password = gr.Textbox(label="Password", type="password", placeholder="Enter your password", value="ugd!")
|
| 468 |
with gr.Row():
|
| 469 |
login_button = gr.Button("Login", size="sm")
|
| 470 |
login_message = gr.Markdown(visible=False)
|