DanielRegaladoCardoso commited on
Commit
3250be2
·
verified ·
1 Parent(s): 64f498d

Add gr.LoginButton for HF OAuth

Browse files
Files changed (1) hide show
  1. app.py +12 -20
app.py CHANGED
@@ -100,22 +100,17 @@ footer { display: none !important; }
100
  .app-title { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
101
  .app-subtitle { font-size: 13px; color: var(--ink-muted); }
102
 
103
- .quota-banner {
104
- font-size: 12px;
105
- color: var(--ink-muted);
106
- background: var(--accent-soft);
107
- border: 1px solid var(--ink-faint);
108
- border-radius: var(--radius-sm);
109
- padding: 9px 14px;
110
- margin: -16px 0 22px;
111
- line-height: 1.5;
112
- }
113
- .quota-banner a {
114
- color: var(--accent);
115
- text-decoration: none;
116
- font-weight: 500;
117
  }
118
- .quota-banner a:hover { text-decoration: underline; }
119
 
120
  /* File upload — compact, Apple-style */
121
  .upload-row { margin-bottom: 18px; }
@@ -643,12 +638,9 @@ def build_app() -> gr.Blocks:
643
  '<div class="app-subtitle">Ask anything about your data.</div>'
644
  '</div>'
645
  '</div>'
646
- '<div class="quota-banner">'
647
- 'Running on HF ZeroGPU. '
648
- '<a href="https://huggingface.co/login" target="_blank" rel="noopener">Sign in to Hugging Face</a> '
649
- 'for the full daily GPU quota (anonymous users hit limits fast).'
650
- '</div>'
651
  )
 
 
652
 
653
  # Upload
654
  with gr.Row(elem_classes=["upload-row"]):
 
100
  .app-title { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
101
  .app-subtitle { font-size: 13px; color: var(--ink-muted); }
102
 
103
+ /* HF Login button — make it Apple-style */
104
+ [data-testid="login-button"], .login-button, button[aria-label*="login"], button[aria-label*="Login"] {
105
+ background: var(--ink) !important;
106
+ color: var(--surface) !important;
107
+ border: none !important;
108
+ border-radius: var(--radius-sm) !important;
109
+ font-weight: 500 !important;
110
+ padding: 8px 14px !important;
111
+ font-size: 13px !important;
112
+ margin-bottom: 18px !important;
 
 
 
 
113
  }
 
114
 
115
  /* File upload — compact, Apple-style */
116
  .upload-row { margin-bottom: 18px; }
 
638
  '<div class="app-subtitle">Ask anything about your data.</div>'
639
  '</div>'
640
  '</div>'
 
 
 
 
 
641
  )
642
+ # Hugging Face login button — required for ZeroGPU quota
643
+ gr.LoginButton(value="Sign in with Hugging Face", size="sm")
644
 
645
  # Upload
646
  with gr.Row(elem_classes=["upload-row"]):