Severian commited on
Commit
9c636a2
·
verified ·
1 Parent(s): 56cac7d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -8
app.py CHANGED
@@ -45,11 +45,6 @@ CAPTION_TYPE_MAP = {
45
 
46
  HF_TOKEN = os.environ.get("HF_TOKEN", None)
47
 
48
- def login(username, password):
49
- if username == USERNAME and password == PASSWORD:
50
- return gr.update(visible=True), gr.update(visible=False), gr.update(visible=False), gr.update(value="Login successful! You can now access the QR Code Art Generator tab.", visible=True)
51
- else:
52
- 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)
53
 
54
  class ImageAdapter(nn.Module):
55
  def __init__(self, input_features: int, output_features: int, ln1: bool, pos_emb: bool, num_image_tokens: int, deep_extract: bool):
@@ -291,7 +286,7 @@ img {
291
  }
292
  .centered-image {
293
  display: block;
294
- margin-left: 0;
295
  margin-right: auto;
296
  max-width: 100%;
297
  height: auto;
@@ -424,6 +419,12 @@ color_effects_info = {
424
  def get_dropdown_choices(info_dict):
425
  return [f"{key}: {value}" for key, value in info_dict.items()]
426
 
 
 
 
 
 
 
427
  # Gradio interface
428
  with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True) as demo:
429
  with gr.Tab("Welcome"):
@@ -431,7 +432,7 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
431
  with gr.Column(scale=2):
432
  gr.Markdown(
433
  """
434
- <img src="https://cdn-uploads.huggingface.co/production/uploads/64740cf7485a7c8e1bd51ac9/LVZnwLV43UUvKu3HORqSs.webp" alt="UDG" width="250" style="max-width: 100%; height: auto;">
435
 
436
  # 🎨 Underground Digital's Caption Captain: AI-Powered Art Inspiration
437
 
@@ -458,7 +459,16 @@ with gr.Blocks(theme="Hev832/Applio", css=css, fill_width=True, fill_height=True
458
  Once logged in, a new tab will appear named<br>
459
  "QR Code Art Generator" allowing you to access.
460
  """
461
- )
 
 
 
 
 
 
 
 
 
462
  with gr.Tab("Caption Captain") as app_container:
463
  with gr.Accordion("How to Use Caption Captain", open=False):
464
  gr.Markdown("""
 
45
 
46
  HF_TOKEN = os.environ.get("HF_TOKEN", None)
47
 
 
 
 
 
 
48
 
49
  class ImageAdapter(nn.Module):
50
  def __init__(self, input_features: int, output_features: int, ln1: bool, pos_emb: bool, num_image_tokens: int, deep_extract: bool):
 
286
  }
287
  .centered-image {
288
  display: block;
289
+ margin-left: auto;
290
  margin-right: auto;
291
  max-width: 100%;
292
  height: auto;
 
419
  def get_dropdown_choices(info_dict):
420
  return [f"{key}: {value}" for key, value in info_dict.items()]
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 QR Code Art Generator 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:
430
  with gr.Tab("Welcome"):
 
432
  with gr.Column(scale=2):
433
  gr.Markdown(
434
  """
435
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/64740cf7485a7c8e1bd51ac9/LVZnwLV43UUvKu3HORqSs.webp" alt="UDG" width="250" style="max-width: 100%; height: auto; class="centered-image">
436
 
437
  # 🎨 Underground Digital's Caption Captain: AI-Powered Art Inspiration
438
 
 
459
  Once logged in, a new tab will appear named<br>
460
  "QR Code Art Generator" allowing you to access.
461
  """
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)
471
+
472
  with gr.Tab("Caption Captain") as app_container:
473
  with gr.Accordion("How to Use Caption Captain", open=False):
474
  gr.Markdown("""