Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,8 +18,9 @@ API_URL = os.getenv("API_URL", "http://localhost:8000")
|
|
| 18 |
API_KEY = os.getenv("API_KEY", "")
|
| 19 |
DEFAULT_KEYWORDS = "s铆, no, quiz谩s, imposible, hola, adi贸s, gracias, por favor"
|
| 20 |
|
| 21 |
-
# Autenticaci贸n (opcional)
|
| 22 |
-
|
|
|
|
| 23 |
|
| 24 |
# ============================================================================
|
| 25 |
# ESTILOS CSS
|
|
@@ -375,17 +376,12 @@ with gr.Blocks(title="馃幆 Keyword Spotting") as demo:
|
|
| 375 |
# MAIN
|
| 376 |
# ============================================================================
|
| 377 |
|
| 378 |
-
def check_password(username: str, password: str) -> bool:
|
| 379 |
-
"""Valida solo la contrase帽a (ignora el usuario)."""
|
| 380 |
-
return password == GRADIO_PASSWORD
|
| 381 |
-
|
| 382 |
-
|
| 383 |
if __name__ == "__main__":
|
| 384 |
# Configurar autenticaci贸n si hay contrase帽a
|
| 385 |
auth = None
|
| 386 |
if GRADIO_PASSWORD:
|
| 387 |
-
auth =
|
| 388 |
-
print("馃攼 Autenticaci贸n habilitada
|
| 389 |
else:
|
| 390 |
print("鈿狅笍 Sin autenticaci贸n. Configura GRADIO_PASSWORD para proteger la app.")
|
| 391 |
|
|
|
|
| 18 |
API_KEY = os.getenv("API_KEY", "")
|
| 19 |
DEFAULT_KEYWORDS = "s铆, no, quiz谩s, imposible, hola, adi贸s, gracias, por favor"
|
| 20 |
|
| 21 |
+
# Autenticaci贸n (opcional)
|
| 22 |
+
GRADIO_USERNAME = os.getenv("GRADIO_USERNAME")
|
| 23 |
+
GRADIO_PASSWORD = os.getenv("GRADIO_PASSWORD")
|
| 24 |
|
| 25 |
# ============================================================================
|
| 26 |
# ESTILOS CSS
|
|
|
|
| 376 |
# MAIN
|
| 377 |
# ============================================================================
|
| 378 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 379 |
if __name__ == "__main__":
|
| 380 |
# Configurar autenticaci贸n si hay contrase帽a
|
| 381 |
auth = None
|
| 382 |
if GRADIO_PASSWORD:
|
| 383 |
+
auth = (GRADIO_USERNAME, GRADIO_PASSWORD)
|
| 384 |
+
print(f"馃攼 Autenticaci贸n habilitada. Usuario: {GRADIO_USERNAME}")
|
| 385 |
else:
|
| 386 |
print("鈿狅笍 Sin autenticaci贸n. Configura GRADIO_PASSWORD para proteger la app.")
|
| 387 |
|