keefereuther Cursor commited on
Commit
bca0fff
·
1 Parent(s): 3941dd3

Rename app to TritonAI Chatbot and fix login page i18n labels.

Browse files

Use explicit English translations for Gradio's auth UI so Spaces no longer show raw login.* keys.

Co-authored-by: Cursor <cursoragent@cursor.com>

Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +20 -4
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: Chatbot Template
3
  emoji: 💬
4
  colorFrom: yellow
5
  colorTo: purple
 
1
  ---
2
+ title: TritonAI Chatbot
3
  emoji: 💬
4
  colorFrom: yellow
5
  colorTo: purple
app.py CHANGED
@@ -349,7 +349,7 @@ demo = gr.ChatInterface(
349
  file_types=["image", ".txt", ".csv", ".py", ".md", ".json", ".pdf"],
350
  scale=7
351
  ),
352
- title="OmniChat",
353
  description=(
354
  "A minimal, multimodal chat interface routed through LiteLLM. "
355
  "Note: conversations are logged for research purposes."
@@ -361,7 +361,7 @@ if __name__ == "__main__":
361
 
362
  custom_login_html = """
363
  <div style="text-align: center; padding: 10px;">
364
- <h2 style="color: #4F46E5; margin-bottom: 5px; font-family: sans-serif;">🌌 Gradio Chatbot Template</h2>
365
  <p style="color: #6B7280; font-size: 14px; font-family: sans-serif;">Authorized access only. Please provide your credentials to wake up the LLMs.</p>
366
  <p style="color: #9CA3AF; font-size: 12px; font-family: sans-serif;">Conversations are recorded for research. By signing in you consent to this logging.</p>
367
  </div>
@@ -380,5 +380,21 @@ if __name__ == "__main__":
380
 
381
  return valid_users.get(username) == password
382
 
383
- # Pass the custom HTML into the auth_message parameter
384
- demo.launch(auth=verify_login, auth_message=custom_login_html)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
349
  file_types=["image", ".txt", ".csv", ".py", ".md", ".json", ".pdf"],
350
  scale=7
351
  ),
352
+ title="TritonAI Chatbot",
353
  description=(
354
  "A minimal, multimodal chat interface routed through LiteLLM. "
355
  "Note: conversations are logged for research purposes."
 
361
 
362
  custom_login_html = """
363
  <div style="text-align: center; padding: 10px;">
364
+ <h2 style="color: #4F46E5; margin-bottom: 5px; font-family: sans-serif;">TritonAI Chatbot</h2>
365
  <p style="color: #6B7280; font-size: 14px; font-family: sans-serif;">Authorized access only. Please provide your credentials to wake up the LLMs.</p>
366
  <p style="color: #9CA3AF; font-size: 12px; font-family: sans-serif;">Conversations are recorded for research. By signing in you consent to this logging.</p>
367
  </div>
 
380
 
381
  return valid_users.get(username) == password
382
 
383
+ # Gradio's built-in login page uses i18n keys (login.login, login.username, …).
384
+ # On some Spaces those bundles load late and the raw keys show; supply English explicitly.
385
+ _i18n = gr.I18n(
386
+ en={
387
+ "login": {
388
+ "login": "Log in",
389
+ "username": "Username",
390
+ "password": "Password",
391
+ "incorrect_credentials": "Incorrect username or password.",
392
+ "enable_cookies": (
393
+ "If you are visiting a HuggingFace Space in Incognito mode, "
394
+ "you must enable third party cookies."
395
+ ),
396
+ },
397
+ },
398
+ )
399
+
400
+ demo.launch(auth=verify_login, auth_message=custom_login_html, i18n=_i18n)