aimodelshare 0.3.94__py3-none-any.whl → 0.4.71__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -488,17 +488,17 @@ MODEL_TYPES = {
488
488
  ),
489
489
  "card_es": "Este modelo es rápido, fiable y equilibrat. Buen punto de partida; suele dar resultados estables en muchos casos."
490
490
  },
491
- "The Rule-Maker": {
491
+ "El Creador de Reglas": {
492
492
  "model_builder": lambda: DecisionTreeClassifier(
493
493
  random_state=42, class_weight="balanced"
494
494
  ),
495
495
  "card_es": "Este modelo aprende reglas simples del tipo «si/entonces». Fácil de entender, pero le cuesta captar patrones complejos."
496
496
  },
497
- "The 'Nearest Neighbor'": {
497
+ "El 'Vecino más Cercano'": {
498
498
  "model_builder": lambda: KNeighborsClassifier(),
499
499
  "card_es": "Este modelo se basa en los ejemplos más parecidos del pasado. «Si te pareces a estos casos, predeciré el mismo resultado»."
500
500
  },
501
- "The Deep Pattern-Finder": {
501
+ "El Buscador de Patrones Profundos": {
502
502
  "model_builder": lambda: RandomForestClassifier(
503
503
  random_state=42, class_weight="balanced"
504
504
  ),
@@ -786,7 +786,7 @@ def _background_initializer():
786
786
  INIT_FLAGS["competition"] = True
787
787
  except Exception as e:
788
788
  with INIT_LOCK:
789
- INIT_FLAGS["errors"].append(f"Competition connection failed: {str(e)}")
789
+ INIT_FLAGS["errors"].append(f"Fallo en la conexión con la competición: {str(e)}")
790
790
 
791
791
  try:
792
792
  # Step 2: Load dataset core (train/test split)
@@ -795,7 +795,7 @@ def _background_initializer():
795
795
  INIT_FLAGS["dataset_core"] = True
796
796
  except Exception as e:
797
797
  with INIT_LOCK:
798
- INIT_FLAGS["errors"].append(f"Dataset loading failed: {str(e)}")
798
+ INIT_FLAGS["errors"].append(f"Error al cargar el conjunto de datos principal: {str(e)}")
799
799
  return # Cannot proceed without data
800
800
 
801
801
  try:
@@ -805,7 +805,7 @@ def _background_initializer():
805
805
  INIT_FLAGS["warm_mini"] = True
806
806
  except Exception as e:
807
807
  with INIT_LOCK:
808
- INIT_FLAGS["errors"].append(f"Warm mini dataset failed: {str(e)}")
808
+ INIT_FLAGS["errors"].append(f"Error al generar la vista previa instantánea: {str(e)}")
809
809
 
810
810
  # Progressive sampling - samples are already created in load_and_prep_data
811
811
  # Just mark them as ready sequentially with delays to simulate progressive loading
@@ -817,7 +817,7 @@ def _background_initializer():
817
817
  INIT_FLAGS["pre_samples_small"] = True
818
818
  except Exception as e:
819
819
  with INIT_LOCK:
820
- INIT_FLAGS["errors"].append(f"Small sample failed: {str(e)}")
820
+ INIT_FLAGS["errors"].append(f"Error en la muestra pequeña: {str(e)}")
821
821
 
822
822
  try:
823
823
  # Step 4b: Medium sample (60%)
@@ -826,7 +826,7 @@ def _background_initializer():
826
826
  INIT_FLAGS["pre_samples_medium"] = True
827
827
  except Exception as e:
828
828
  with INIT_LOCK:
829
- INIT_FLAGS["errors"].append(f"Medium sample failed: {str(e)}")
829
+ INIT_FLAGS["errors"].append(f"Error en la muestra mediana: {str(e)}")
830
830
 
831
831
  try:
832
832
  # Step 4c: Large sample (80%)
@@ -835,7 +835,7 @@ def _background_initializer():
835
835
  INIT_FLAGS["pre_samples_large"] = True
836
836
  except Exception as e:
837
837
  with INIT_LOCK:
838
- INIT_FLAGS["errors"].append(f"Large sample failed: {str(e)}")
838
+ INIT_FLAGS["errors"].append(f"Error en la muestra grande: {str(e)}")
839
839
  print(f"✗ Large sample failed: {e}")
840
840
 
841
841
  try:
@@ -846,7 +846,7 @@ def _background_initializer():
846
846
  INIT_FLAGS["pre_samples_full"] = True
847
847
  except Exception as e:
848
848
  with INIT_LOCK:
849
- INIT_FLAGS["errors"].append(f"Full sample failed: {str(e)}")
849
+ INIT_FLAGS["errors"].append(f"Error en la muestra completa: {str(e)}")
850
850
 
851
851
  try:
852
852
  # Step 5: Leaderboard prefetch (best-effort, unauthenticated)
@@ -858,7 +858,7 @@ def _background_initializer():
858
858
  INIT_FLAGS["leaderboard"] = True
859
859
  except Exception as e:
860
860
  with INIT_LOCK:
861
- INIT_FLAGS["errors"].append(f"Leaderboard prefetch failed: {str(e)}")
861
+ INIT_FLAGS["errors"].append(f"Error al obtener la tabla de clasificación: {str(e)}")
862
862
 
863
863
  try:
864
864
  # Step 6: Default preprocessor on small sample
@@ -867,7 +867,7 @@ def _background_initializer():
867
867
  INIT_FLAGS["default_preprocessor"] = True
868
868
  except Exception as e:
869
869
  with INIT_LOCK:
870
- INIT_FLAGS["errors"].append(f"Default preprocessor failed: {str(e)}")
870
+ INIT_FLAGS["errors"].append(f"Error en el sistema de preprocesamiento: {str(e)}")
871
871
  print(f"✗ Default preprocessor failed: {e}")
872
872
 
873
873
 
@@ -1293,7 +1293,7 @@ def _build_kpi_card_html(new_score, last_score, new_rank, last_rank, submission_
1293
1293
 
1294
1294
  # Handle pending state - show processing message with provisional diff
1295
1295
  if is_pending:
1296
- title = "⏳ Submission Processing"
1296
+ title = "⏳ Procesando envío"
1297
1297
  acc_color = "#3b82f6" # Blue
1298
1298
  acc_text = f"{(local_test_accuracy * 100):.2f}%" if local_test_accuracy is not None else "N/A"
1299
1299
 
@@ -1301,60 +1301,60 @@ def _build_kpi_card_html(new_score, last_score, new_rank, last_rank, submission_
1301
1301
  if local_test_accuracy is not None and last_score is not None and last_score > 0:
1302
1302
  score_diff = local_test_accuracy - last_score
1303
1303
  if abs(score_diff) < 0.0001:
1304
- acc_diff_html = "<p style='font-size: 1.5rem; font-weight: 600; color: #6b7280; margin:0;'>No Change (↔) <span style='font-size: 0.9rem; color: #9ca3af;'>(Provisional)</span></p><p style='font-size: 1.2rem; font-weight: 500; color: #6b7280; margin:0; padding-top: 8px;'>Pending leaderboard update...</p>"
1304
+ acc_diff_html = "<p style='font-size: 1.5rem; font-weight: 600; color: #6b7280; margin:0;'>Sin cambios (↔) <span style='font-size: 0.9rem; color: #9ca3af;'>(Provisional)</span></p><p style='font-size: 1.2rem; font-weight: 500; color: #6b7280; margin:0; padding-top: 8px;'>Actualizando la clasificación...</p>"
1305
1305
  elif score_diff > 0:
1306
- acc_diff_html = f"<p style='font-size: 1.5rem; font-weight: 600; color: #16a34a; margin:0;'>+{(score_diff * 100):.2f} (⬆️) <span style='font-size: 0.9rem; color: #9ca3af;'>(Provisional)</span></p><p style='font-size: 1.2rem; font-weight: 500; color: #6b7280; margin:0; padding-top: 8px;'>Pending leaderboard update...</p>"
1306
+ acc_diff_html = f"<p style='font-size: 1.5rem; font-weight: 600; color: #16a34a; margin:0;'>+{(score_diff * 100):.2f} (⬆️) <span style='font-size: 0.9rem; color: #9ca3af;'>(Provisional)</span></p><p style='font-size: 1.2rem; font-weight: 500; color: #6b7280; margin:0; padding-top: 8px;'>Actualizando la clasificación...</p>"
1307
1307
  else:
1308
- acc_diff_html = f"<p style='font-size: 1.5rem; font-weight: 600; color: #ef4444; margin:0;'>{(score_diff * 100):.2f} (⬇️) <span style='font-size: 0.9rem; color: #9ca3af;'>(Provisional)</span></p><p style='font-size: 1.2rem; font-weight: 500; color: #6b7280; margin:0; padding-top: 8px;'>Pending leaderboard update...</p>"
1308
+ acc_diff_html = f"<p style='font-size: 1.5rem; font-weight: 600; color: #ef4444; margin:0;'>{(score_diff * 100):.2f} (⬇️) <span style='font-size: 0.9rem; color: #9ca3af;'>(Provisional)</span></p><p style='font-size: 1.2rem; font-weight: 500; color: #6b7280; margin:0; padding-top: 8px;'>Actualizando la clasificación...</p>"
1309
1309
  else:
1310
1310
  # No last score available - just show pending message
1311
- acc_diff_html = "<p style='font-size: 1.2rem; font-weight: 500; color: #6b7280; margin:0; padding-top: 8px;'>Pending leaderboard update...</p>"
1311
+ acc_diff_html = "<p style='font-size: 1.2rem; font-weight: 500; color: #6b7280; margin:0; padding-top: 8px;'>Actualizando la clasificación...</p>"
1312
1312
 
1313
1313
  border_color = acc_color
1314
1314
  rank_color = "#6b7280" # Gray
1315
- rank_text = "Pending"
1316
- rank_diff_html = "<p style='font-size: 1.2rem; font-weight: 500; color: #6b7280; margin:0;'>Calculating rank...</p>"
1315
+ rank_text = "Pendiente"
1316
+ rank_diff_html = "<p style='font-size: 1.2rem; font-weight: 500; color: #6b7280; margin:0;'>Calculando posición...</p>"
1317
1317
 
1318
1318
  # Handle preview mode - Styled to match "success" card
1319
1319
  elif is_preview:
1320
- title = "🔬 Successful Preview Run!"
1320
+ title = "🔬 ¡Prueba completada con éxito!"
1321
1321
  acc_color = "#16a34a" # Green (like success)
1322
1322
  acc_text = f"{(new_score * 100):.2f}%" if new_score > 0 else "N/A"
1323
- acc_diff_html = "<p style='font-size: 1.2rem; font-weight: 500; color: #6b7280; margin:0; padding-top: 8px;'>(Preview only - not submitted)</p>" # Neutral color
1323
+ acc_diff_html = "<p style='font-size: 1.2rem; font-weight: 500; color: #6b7280; margin:0; padding-top: 8px;'>(Solo prueba - no enviado)</p>" # Neutral color
1324
1324
  border_color = acc_color # Green border
1325
1325
  rank_color = "#3b82f6" # Blue (like rank)
1326
1326
  rank_text = "N/A" # Placeholder
1327
- rank_diff_html = "<p style='font-size: 1.2rem; font-weight: 500; color: #6b7280; margin:0;'>Not ranked (preview)</p>" # Neutral color
1327
+ rank_diff_html = "<p style='font-size: 1.2rem; font-weight: 500; color: #6b7280; margin:0;'>Sin clasificar (prueba)</p>" # Neutral color
1328
1328
 
1329
1329
  # 1. Handle First Submission
1330
1330
  elif submission_count == 0:
1331
- title = "🎉 First Model Submitted!"
1331
+ title = "🎉 ¡Primer modelo enviado!"
1332
1332
  acc_color = "#16a34a" # green
1333
1333
  acc_text = f"{(new_score * 100):.2f}%"
1334
- acc_diff_html = "<p style='font-size: 1.2rem; font-weight: 500; color: #6b7280; margin:0; padding-top: 8px;'>(Your first score!)</p>"
1334
+ acc_diff_html = "<p style='font-size: 1.2rem; font-weight: 500; color: #6b7280; margin:0; padding-top: 8px;'>(¡Tu primera puntuación!)</p>"
1335
1335
 
1336
1336
  rank_color = "#3b82f6" # blue
1337
1337
  rank_text = f"#{new_rank}"
1338
- rank_diff_html = "<p style='font-size: 1.5rem; font-weight: 600; color: #3b82f6; margin:0;'>You're on the board!</p>"
1338
+ rank_diff_html = "<p style='font-size: 1.5rem; font-weight: 600; color: #3b82f6; margin:0;'>¡Ya estás en la tabla!</p>"
1339
1339
  border_color = acc_color
1340
1340
 
1341
1341
  else:
1342
1342
  # 2. Handle Score Changes
1343
1343
  score_diff = new_score - last_score
1344
1344
  if abs(score_diff) < 0.0001:
1345
- title = "✅ Submission Successful"
1345
+ title = "✅ Envío realizado con éxito"
1346
1346
  acc_color = "#6b7280" # gray
1347
1347
  acc_text = f"{(new_score * 100):.2f}%"
1348
- acc_diff_html = f"<p style='font-size: 1.5rem; font-weight: 600; color: {acc_color}; margin:0;'>No Change (↔)</p>"
1348
+ acc_diff_html = f"<p style='font-size: 1.5rem; font-weight: 600; color: {acc_color}; margin:0;'>Sin variaciones (↔)</p>"
1349
1349
  border_color = acc_color
1350
1350
  elif score_diff > 0:
1351
- title = "✅ Submission Successful!"
1351
+ title = "✅ Envío éxitoso!"
1352
1352
  acc_color = "#16a34a" # green
1353
1353
  acc_text = f"{(new_score * 100):.2f}%"
1354
1354
  acc_diff_html = f"<p style='font-size: 1.5rem; font-weight: 600; color: {acc_color}; margin:0;'>+{(score_diff * 100):.2f} (⬆️)</p>"
1355
1355
  border_color = acc_color
1356
1356
  else:
1357
- title = "📉 Score Dropped"
1357
+ title = "📉 Tu puntuación ha bajado"
1358
1358
  acc_color = "#ef4444" # red
1359
1359
  acc_text = f"{(new_score * 100):.2f}%"
1360
1360
  acc_diff_html = f"<p style='font-size: 1.5rem; font-weight: 600; color: {acc_color}; margin:0;'>{(score_diff * 100):.2f} (⬇️)</p>"
@@ -1365,25 +1365,25 @@ def _build_kpi_card_html(new_score, last_score, new_rank, last_rank, submission_
1365
1365
  rank_color = "#3b82f6" # blue
1366
1366
  rank_text = f"#{new_rank}"
1367
1367
  if last_rank == 0: # Handle first rank
1368
- rank_diff_html = "<p style='font-size: 1.5rem; font-weight: 600; color: #3b82f6; margin:0;'>You're on the board!</p>"
1368
+ rank_diff_html = "<p style='font-size: 1.5rem; font-weight: 600; color: #3b82f6; margin:0;'>¡Ya estás en la tabla!</p>"
1369
1369
  elif rank_diff > 0:
1370
- rank_diff_html = f"<p style='font-size: 1.5rem; font-weight: 600; color: #16a34a; margin:0;'>🚀 Moved up {rank_diff} spot{'s' if rank_diff > 1 else ''}!</p>"
1370
+ rank_diff_html = f"<p style='font-size: 1.5rem; font-weight: 600; color: #16a34a; margin:0;'>🚀 ¡Has subido {rank_diff} posición(es)!</p>"
1371
1371
  elif rank_diff < 0:
1372
- rank_diff_html = f"<p style='font-size: 1.5rem; font-weight: 600; color: #ef4444; margin:0;'>🔻 Dropped {abs(rank_diff)} spot{'s' if abs(rank_diff) > 1 else ''}</p>"
1372
+ rank_diff_html = f"<p style='font-size: 1.5rem; font-weight: 600; color: #ef4444; margin:0;'>🔻 Has bajado {abs(rank_diff)} posición(es)</p>"
1373
1373
  else:
1374
- rank_diff_html = f"<p style='font-size: 1.5rem; font-weight: 600; color: {rank_color}; margin:0;'>No Change (↔)</p>"
1374
+ rank_diff_html = f"<p style='font-size: 1.5rem; font-weight: 600; color: {rank_color}; margin:0;'>Mantienes tu posición (↔)</p>"
1375
1375
 
1376
1376
  return f"""
1377
1377
  <div class='kpi-card' style='border-color: {border_color};'>
1378
1378
  <h2 style='color: #111827; margin-top:0;'>{title}</h2>
1379
1379
  <div class='kpi-card-body'>
1380
1380
  <div class='kpi-metric-box'>
1381
- <p class='kpi-label'>New Accuracy</p>
1381
+ <p class='kpi-label'>Nueva precisión</p>
1382
1382
  <p class='kpi-score' style='color: {acc_color};'>{acc_text}</p>
1383
1383
  {acc_diff_html}
1384
1384
  </div>
1385
1385
  <div class='kpi-metric-box'>
1386
- <p class='kpi-label'>Your Rank</p>
1386
+ <p class='kpi-label'>Tu posición</p>
1387
1387
  <p class='kpi-score' style='color: {rank_color};'>{rank_text}</p>
1388
1388
  {rank_diff_html}
1389
1389
  </div>
@@ -1402,7 +1402,7 @@ def _build_team_html(team_summary_df, team_name):
1402
1402
  use the unmodified English team names from the DataFrame.
1403
1403
  """
1404
1404
  if team_summary_df is None or team_summary_df.empty:
1405
- return "<p style='text-align:center; color:#6b7280; padding-top:20px;'>No team submissions yet.</p>"
1405
+ return "<p style='text-align:center; color:#6b7280; padding-top:20px;'>Aún no hay envíos de equipos.</p>"
1406
1406
 
1407
1407
  # Normalize the current user's team name for comparison (using English names)
1408
1408
  normalized_user_team = _normalize_team_name(team_name).lower()
@@ -1411,11 +1411,11 @@ def _build_team_html(team_summary_df, team_name):
1411
1411
  <table class='leaderboard-html-table'>
1412
1412
  <thead>
1413
1413
  <tr>
1414
- <th>Rank</th>
1415
- <th>Team</th>
1416
- <th>Best_Score</th>
1417
- <th>Avg_Score</th>
1418
- <th>Submissions</th>
1414
+ <th>Posición</th>
1415
+ <th>Equipo</th>
1416
+ <th>Mejor Puntuación</th>
1417
+ <th>Media</th>
1418
+ <th>Envíos</th>
1419
1419
  </tr>
1420
1420
  </thead>
1421
1421
  <tbody>
@@ -1447,16 +1447,16 @@ def _build_team_html(team_summary_df, team_name):
1447
1447
  def _build_individual_html(individual_summary_df, username):
1448
1448
  """Generates the HTML for the individual leaderboard."""
1449
1449
  if individual_summary_df is None or individual_summary_df.empty:
1450
- return "<p style='text-align:center; color:#6b7280; padding-top:20px;'>No individual submissions yet.</p>"
1450
+ return "<p style='text-align:center; color:#6b7280; padding-top:20px;'>Aún no hay envíos individuales.</p>"
1451
1451
 
1452
1452
  header = """
1453
1453
  <table class='leaderboard-html-table'>
1454
1454
  <thead>
1455
1455
  <tr>
1456
- <th>Rank</th>
1457
- <th>Engineer</th>
1458
- <th>Best_Score</th>
1459
- <th>Submissions</th>
1456
+ <th>Posición</th>
1457
+ <th>Ingeniero/a</th>
1458
+ <th>Mejor Puntuación</th>
1459
+ <th>Envíos</th>
1460
1460
  </tr>
1461
1461
  </thead>
1462
1462
  <tbody>
@@ -1864,9 +1864,9 @@ def perform_inline_login(username_input, password_input):
1864
1864
 
1865
1865
  # Build success message based on whether team is new or existing
1866
1866
  if is_new_team:
1867
- team_message = f"Has sido asignado a un nuevo equipo: <b>{display_team_name}</b> 🎉"
1867
+ team_message = f"¡Todo listo! Tu equipo es: <b>{display_team_name}</b> 🎉"
1868
1868
  else:
1869
- team_message = f"¡Bienvenido de vuelta! Permaneces en el equipo: <b>{display_team_name}</b> ✅"
1869
+ team_message = f"Hola de nuevo! Sigues en el equipo: <b>{display_team_name}</b> ✅"
1870
1870
 
1871
1871
  # Success: hide login form, show success message with team info, enable submit button
1872
1872
  success_html = f"""
@@ -1876,7 +1876,7 @@ def perform_inline_login(username_input, password_input):
1876
1876
  {team_message}
1877
1877
  </p>
1878
1878
  <p style='margin:8px 0 0 0; color:#166534; font-size:0.95rem;'>
1879
- Haz clic en "Build & Submit Model" nuevamente para publicar tu puntuación.
1879
+ Haz clic de nuevo en "Construir y enviar el modelo" para publicar tu puntuación.
1880
1880
  </p>
1881
1881
  </div>
1882
1882
  """
@@ -1949,8 +1949,19 @@ def run_experiment(
1949
1949
  """
1950
1950
  # --- COLLISION GUARDS ---
1951
1951
  if isinstance(submit_button, dict) or isinstance(submission_feedback_display, dict) or isinstance(kpi_meta_state, dict) or isinstance(was_preview_state, dict):
1952
- error_html = "<div style='color:red'>Configuration Error: Parameter shadowing. Refresh page.</div>"
1953
- yield { submission_feedback_display: gr.update(value=error_html, visible=True) }
1952
+ error_html = """
1953
+ <div class='kpi-card' style='border-color: #ef4444;'>
1954
+ <h2 style='color: #111827; margin-top:0;'>⚠️ Error de configuración</h2>
1955
+ <div class='kpi-card-body'>
1956
+ <p style='color: #991b1b;'>Se ha detectado un conflicto de parámetros (shadowing). Las variables globales del componente han sido sobrescritas por parámetros locales.</p>
1957
+ <p style='color: #7f1d1d; margin-top: 8px;'>Por favor, actualiza la página e inténtalo de nuevo. Si el problema persiste, contacta con soporte técnico.</p>
1958
+ </div>
1959
+ </div>
1960
+ """
1961
+ yield {
1962
+ submission_feedback_display: gr.update(value=error_html, visible=True),
1963
+ submit_button: gr.update(value="🔬 Construir y enviar modelo", interactive=True)
1964
+ }
1954
1965
  return
1955
1966
 
1956
1967
  # --- TRANSLATION LOGIC ---
@@ -1971,12 +1982,12 @@ def run_experiment(
1971
1982
  def get_status_html(step_num, title, subtitle):
1972
1983
  return f"<div class='processing-status'><span class='processing-icon'>⚙️</span><div class='processing-text'>Step {step_num}/5: {title}</div><div class='processing-subtext'>{subtitle}</div></div>"
1973
1984
 
1974
- # --- Stage 1: Lock UI ---
1975
- progress(0.1, desc="Starting Experiment...")
1976
- yield {
1977
- submit_button: gr.update(value="⏳ Experiment Running...", interactive=False),
1978
- submission_feedback_display: gr.update(value=get_status_html(1, "Inicializando", "Preparando tus ingredientes de datos..."), visible=True),
1979
- login_error: gr.update(visible=False),
1985
+ # --- Stage 1: Lock UI and give initial feedback ---
1986
+ progress(0.1, desc="Iniciando experimento...")
1987
+ initial_updates = {
1988
+ submit_button: gr.update(value="⏳ Experimento en marcha...", interactive=False),
1989
+ submission_feedback_display: gr.update(value=get_status_html(1, "Iniciando", "Preparando las variables de tu data..."), visible=True), # Make sure it's visible
1990
+ login_error: gr.update(visible=False), # Hide login success/error message
1980
1991
  attempts_tracker_display: gr.update(value=_build_attempts_tracker_html(submission_count))
1981
1992
  }
1982
1993
 
@@ -2109,24 +2120,24 @@ def run_experiment(
2109
2120
  if submission_count >= ATTEMPT_LIMIT:
2110
2121
  limit_warning_html = f"""
2111
2122
  <div class='kpi-card' style='border-color: #ef4444;'>
2112
- <h2 style='color: #111827; margin-top:0;'>🛑 Submission Limit Reached</h2>
2123
+ <h2 style='color: #111827; margin-top:0;'>🛑 Límite de envíos alcanzado</h2>
2113
2124
  <div class='kpi-card-body'>
2114
2125
  <div class='kpi-metric-box'>
2115
- <p class='kpi-label'>Attempts Used</p>
2126
+ <p class='kpi-label'>Intentos utilizados</p>
2116
2127
  <p class='kpi-score' style='color: #ef4444;'>{ATTEMPT_LIMIT} / {ATTEMPT_LIMIT}</p>
2117
2128
  </div>
2118
2129
  </div>
2119
2130
  <div style='margin-top: 16px; background:#fef2f2; padding:16px; border-radius:12px; text-align:left; font-size:0.98rem; line-height:1.4;'>
2120
- <p style='margin:0; color:#991b1b;'><b>Nice Work!</b> Scroll down to "Finish and Reflect".</p>
2131
+ <p style='margin:0; color:#991b1b;'><b>¡Buen trabajo!</b> Desplázate hacia abajo hasta «Finalizar y reflexionar».</p>
2121
2132
  </div>
2122
2133
  </div>"""
2123
2134
  settings = compute_rank_settings(submission_count, model_name_key, complexity_level, feature_set, data_size_str)
2124
2135
  limit_reached_updates = {
2125
2136
  submission_feedback_display: gr.update(value=limit_warning_html, visible=True),
2126
- submit_button: gr.update(value="🛑 Submission Limit Reached", interactive=False),
2137
+ submit_button: gr.update(value="🛑 Límite de envíos alcanzado", interactive=False),
2127
2138
  model_type_radio: gr.update(interactive=False), complexity_slider: gr.update(interactive=False),
2128
2139
  feature_set_checkbox: gr.update(interactive=False), data_size_radio: gr.update(interactive=False),
2129
- attempts_tracker_display: gr.update(value=f"<div style='text-align:center; padding:8px; margin:8px 0; background:#fef2f2; border-radius:8px; border:1px solid #ef4444;'><p style='margin:0; color:#991b1b; font-weight:600;'>🛑 Attempts used: {ATTEMPT_LIMIT}/{ATTEMPT_LIMIT}</p></div>"),
2140
+ attempts_tracker_display: gr.update(value=f"<div style='text-align:center; padding:8px; margin:8px 0; background:#fef2f2; border-radius:8px; border:1px solid #ef4444;'><p style='margin:0; color:#991b1b; font-weight:600;'>🛑 Intentos utilizados: {ATTEMPT_LIMIT}/{ATTEMPT_LIMIT}</p></div>"),
2130
2141
  team_leaderboard_display: team_leaderboard_display, individual_leaderboard_display: individual_leaderboard_display,
2131
2142
  last_submission_score_state: last_submission_score, last_rank_state: last_rank,
2132
2143
  best_score_state: best_score, submission_count_state: submission_count,
@@ -2138,9 +2149,9 @@ def run_experiment(
2138
2149
  yield limit_reached_updates
2139
2150
  return
2140
2151
 
2141
- progress(0.5, desc="Submitting to Cloud...")
2152
+ progress(0.5, desc="Enviando a la nube...")
2142
2153
  yield {
2143
- submission_feedback_display: gr.update(value=get_status_html(3, "Submitting", "Sending model to the competition server..."), visible=True),
2154
+ submission_feedback_display: gr.update(value=get_status_html(3, "Enviando", "Enviando el modelo al servidor de la competición..."), visible=True),
2144
2155
  login_error: gr.update(visible=False)
2145
2156
  }
2146
2157
 
@@ -2177,14 +2188,14 @@ def run_experiment(
2177
2188
  else:
2178
2189
  this_submission_score = local_test_accuracy
2179
2190
  except Exception as e:
2180
- _log(f"Submission return parsing failed: {e}. Using local accuracy.")
2191
+ _log(f"Falló el análisis de la respuesta del envío: {e}. Uso de precisión local.")
2181
2192
  this_submission_score = local_test_accuracy
2182
2193
 
2183
- _log(f"Submission successful. Server Score: {this_submission_score}")
2194
+ _log(f"Envío exitoso. Puntuación del servidor: {this_submission_score}")
2184
2195
 
2185
2196
  try:
2186
2197
  # Short timeout to trigger the lambda without hanging the UI
2187
- _log("Triggering backend merge...")
2198
+ _log("Iniciando fusión en el backend...")
2188
2199
  playground.get_leaderboard(token=token)
2189
2200
  except Exception:
2190
2201
  # We ignore errors here because the 'submit_model' post
@@ -2199,7 +2210,7 @@ def run_experiment(
2199
2210
  new_first_submission_score = this_submission_score
2200
2211
 
2201
2212
  # --- Stage 4: Local Rank Calculation (Optimistic) ---
2202
- progress(0.9, desc="Calculating Rank...")
2213
+ progress(0.9, desc="Calculando rango...")
2203
2214
 
2204
2215
  # 3. SIMULATE UPDATED LEADERBOARD
2205
2216
  simulated_df = baseline_leaderboard_df.copy() if baseline_leaderboard_df is not None else pd.DataFrame()
@@ -2240,7 +2251,7 @@ def run_experiment(
2240
2251
  # ... (Previous Stage 1-4 logic remains unchanged) ...
2241
2252
 
2242
2253
  # --- Stage 5: Final UI Update ---
2243
- progress(1.0, desc="Complete!")
2254
+ progress(1.0, desc="¡Completado!")
2244
2255
 
2245
2256
  success_kpi_meta = {
2246
2257
  "was_preview": False, "preview_score": None, "ready_at_run_start": ready,
@@ -2261,24 +2272,24 @@ def run_experiment(
2261
2272
  # 1. Append the Limit Warning HTML *below* the Result Card
2262
2273
  limit_html = f"""
2263
2274
  <div style='margin-top: 16px; border: 2px solid #ef4444; background:#fef2f2; padding:16px; border-radius:12px; text-align:left;'>
2264
- <h3 style='margin:0 0 8px 0; color:#991b1b;'>🛑 Submission Limit Reached ({ATTEMPT_LIMIT}/{ATTEMPT_LIMIT})</h3>
2275
+ <h3 style='margin:0 0 8px 0; color:#991b1b;'>🛑 Límite de envíos alcanzado ({ATTEMPT_LIMIT}/{ATTEMPT_LIMIT})</h3>
2265
2276
  <p style='margin:0; color:#7f1d1d; line-height:1.4;'>
2266
- <b>You have used all your attempts for this session.</b><br>
2267
- Review your final results above, then scroll down to "Finish and Reflect" to continue.
2277
+ <b>Has utilizado todos tus intentos para esta sesión.</b><br>
2278
+ Revisa tus resultados finales arriba, luego desplázate hacia abajo hasta 'Finalizar y Reflexionar' para continuar.
2268
2279
  </p>
2269
2280
  </div>
2270
2281
  """
2271
2282
  final_html_display = kpi_card_html + limit_html
2272
2283
 
2273
2284
  # 2. Disable all controls
2274
- button_update = gr.update(value="🛑 Limit Reached", interactive=False)
2285
+ button_update = gr.update(value="🛑 Límite alcanzado", interactive=False)
2275
2286
  interactive_state = False
2276
- tracker_html = f"<div style='text-align:center; padding:8px; margin:8px 0; background:#fef2f2; border-radius:8px; border:1px solid #ef4444;'><p style='margin:0; color:#991b1b; font-weight:600;'>🛑 Attempts used: {ATTEMPT_LIMIT}/{ATTEMPT_LIMIT} (Max)</p></div>"
2287
+ tracker_html = f"<div style='text-align:center; padding:8px; margin:8px 0; background:#fef2f2; border-radius:8px; border:1px solid #ef4444;'><p style='margin:0; color:#991b1b; font-weight:600;'>🛑 Intentos utilizados: {ATTEMPT_LIMIT}/{ATTEMPT_LIMIT} (Max)</p></div>"
2277
2288
 
2278
2289
  else:
2279
2290
  # Normal State: Show just the result card and keep controls active
2280
2291
  final_html_display = kpi_card_html
2281
- button_update = gr.update(value="🔬 Build & Submit Model", interactive=True)
2292
+ button_update = gr.update(value="🔬 Construir y enviar modelo", interactive=True)
2282
2293
  interactive_state = True
2283
2294
  tracker_html = _build_attempts_tracker_html(new_submission_count)
2284
2295
 
@@ -2333,7 +2344,7 @@ def run_experiment(
2333
2344
 
2334
2345
  error_updates = {
2335
2346
  submission_feedback_display: gr.update(
2336
- f"<p style='text-align:center; color:red; padding:20px 0;'>An error occurred: {error_msg}</p>", visible=True
2347
+ f"<p style='text-align:center; color:red; padding:20px 0;'>Ocurrió un error: {error_msg}</p>", visible=True
2337
2348
  ),
2338
2349
  team_leaderboard_display: f"<p style='text-align:center; color:red; padding-top:20px;'>An error occurred: {error_msg}</p>",
2339
2350
  individual_leaderboard_display: f"<p style='text-align:center; color:red; padding-top:20px;'>An error occurred: {error_msg}</p>",
@@ -2383,7 +2394,7 @@ def on_initial_load(username, token=None, team_name=""):
2383
2394
 
2384
2395
  <div style='background:#eff6ff; padding:16px; border-radius:12px; border:2px solid #bfdbfe; display:inline-block;'>
2385
2396
  <p style='margin:0; color:#1e40af; font-weight:bold; font-size:1.1rem;'>
2386
- 👈 ¡Haz clic en "Build & Submit Model" para comenzar a jugar!
2397
+ 👈 ¡Haz clic en el botón "Construir y enviar modelo" para comenzar a jugar!
2387
2398
  </p>
2388
2399
  </div>
2389
2400
  </div>
@@ -3582,7 +3593,7 @@ def create_model_building_game_es_app(theme_primary_hue: str = "indigo") -> "gr.
3582
3593
  <div class='step-visual'>
3583
3594
  <div class='step-visual-box'><b>1. Configura</b><br/>Usa los controles para seleccionar el tipo de modelo y los datos.</div>
3584
3595
  <div class='step-visual-arrow'>→</div>
3585
- <div class='step-visual-box'><b>2. Envía</b><br/>Haz clic en "construir y enviar" para entrenar tu modelo.</div>
3596
+ <div class='step-visual-box'><b>2. Envía</b><br/>Haz clic en "Construir y enviar modelo" para entrenar tu modelo.</div>
3586
3597
  <div class='step-visual-arrow'>→</div>
3587
3598
  <div class='step-visual-box'><b>3. Analiza</b><br/>Mira tu posición en la clasificación en tiempo real.</div>
3588
3599
  <div class='step-visual-arrow'>→</div>
@@ -3635,7 +3646,7 @@ def create_model_building_game_es_app(theme_primary_hue: str = "indigo") -> "gr.
3635
3646
 
3636
3647
  <hr style='margin: 24px 0;'>
3637
3648
 
3638
- <h3>2. Complejidad del Modelo (Nivel de ajuste)</h3>
3649
+ <h3>2. Complejidad del modelo (Nivel de ajuste)</h3>
3639
3650
  <div class='mock-ui-control-box' style='text-align: center;'>
3640
3651
  <p style='font-size: 1.1rem; margin:0;'>Rango: Nivel 1 ─── ● ─── 10</p>
3641
3652
  </div>
@@ -3720,8 +3731,8 @@ def create_model_building_game_es_app(theme_primary_hue: str = "indigo") -> "gr.
3720
3731
  # --- END FIX ---
3721
3732
 
3722
3733
  with gr.Row():
3723
- briefing_6_back = gr.Button("◀️ Back", size="lg")
3724
- briefing_6_next = gr.Button("Next ▶️", variant="primary", size="lg")
3734
+ briefing_6_back = gr.Button("◀️ Atrás", size="lg")
3735
+ briefing_6_next = gr.Button("Siguiente ▶️", variant="primary", size="lg")
3725
3736
 
3726
3737
  # Slide 7: Card 6 (Your Score as an Engineer)
3727
3738
  with gr.Column(visible=False, elem_id="slide-7") as briefing_slide_7:
@@ -3754,15 +3765,15 @@ def create_model_building_game_es_app(theme_primary_hue: str = "indigo") -> "gr.
3754
3765
  # --- END FIX ---
3755
3766
 
3756
3767
  with gr.Row():
3757
- briefing_7_back = gr.Button("◀️ Back", size="lg")
3758
- briefing_7_next = gr.Button("Begin Model Building ▶️", variant="primary", size="lg")
3768
+ briefing_7_back = gr.Button("◀️ Atrás", size="lg")
3769
+ briefing_7_next = gr.Button("Comienza a construir un modelo ▶️", variant="primary", size="lg")
3759
3770
 
3760
3771
  # --- End Briefing Slideshow ---
3761
3772
 
3762
3773
 
3763
3774
  # Model Building App (Main Interface)
3764
3775
  with gr.Column(visible=False, elem_id="model-step") as model_building_step:
3765
- gr.Markdown("<h1 style='text-align:center;'>🛠️ Model Building Arena</h1>")
3776
+ gr.Markdown("<h1 style='text-align:center;'>🛠️ Área de construcción de modelos</h1>")
3766
3777
 
3767
3778
  # Status panel for initialization progress - HIDDEN
3768
3779
  init_status_display = gr.HTML(value="", visible=False)
@@ -3773,7 +3784,7 @@ def create_model_building_game_es_app(theme_primary_hue: str = "indigo") -> "gr.
3773
3784
  value=(
3774
3785
  "<div class='init-banner'>"
3775
3786
  "<p class='init-banner__text'>"
3776
- "⏳ Initializing data & leaderboardyou can explore but must wait for readiness to submit."
3787
+ "⏳ Inicializando datos y clasificaciónpuedes explorar, pero debes esperar a que esté listo para enviar."
3777
3788
  "</p>"
3778
3789
  "</div>"
3779
3790
  ),
@@ -3820,25 +3831,25 @@ def create_model_building_game_es_app(theme_primary_hue: str = "indigo") -> "gr.
3820
3831
  gr.Markdown("---") # Separator
3821
3832
 
3822
3833
  complexity_slider = gr.Slider(
3823
- label="2. Model Complexity (1–10)",
3834
+ label="2. Complejidad del modelo (1–10)",
3824
3835
  minimum=1, maximum=3, step=1, value=2,
3825
- info="Higher values allow deeper pattern learning; very high values may overfit."
3836
+ info="Valores más altos permiten aprender patrones más complejos, pero si son demasiado altos pueden empeorar los resultados."
3826
3837
  )
3827
3838
 
3828
3839
  gr.Markdown("---") # Separator
3829
3840
 
3830
3841
  feature_set_checkbox = gr.CheckboxGroup(
3831
- label="3. Select Data Ingredients",
3842
+ label="3. Selecciona las variables de data",
3832
3843
  choices=FEATURE_SET_ALL_OPTIONS,
3833
3844
  value=DEFAULT_FEATURE_SET,
3834
3845
  interactive=False,
3835
- info="More ingredients unlock as you rank up!"
3846
+ info="¡Se desbloquean más ingredientes según tu posición en la clasificación!"
3836
3847
  )
3837
3848
 
3838
3849
  gr.Markdown("---") # Separator
3839
3850
 
3840
3851
  data_size_radio = gr.Radio(
3841
- label="4. Data Size",
3852
+ label="4. Tamaño de los datos",
3842
3853
  choices=[DEFAULT_DATA_SIZE],
3843
3854
  value=DEFAULT_DATA_SIZE,
3844
3855
  interactive=False
@@ -3855,7 +3866,7 @@ def create_model_building_game_es_app(theme_primary_hue: str = "indigo") -> "gr.
3855
3866
  )
3856
3867
 
3857
3868
  submit_button = gr.Button(
3858
- value="5. 🔬 Build & Submit Model",
3869
+ value="5. 🔬 Construir y enviar el modelo",
3859
3870
  variant="primary",
3860
3871
  size="lg"
3861
3872
  )
@@ -3864,27 +3875,27 @@ def create_model_building_game_es_app(theme_primary_hue: str = "indigo") -> "gr.
3864
3875
  gr.HTML(
3865
3876
  """
3866
3877
  <div class='leaderboard-box'>
3867
- <h3 style='margin-top:0;'>🏆 Live Standings</h3>
3868
- <p style='margin:0;'>Submit a model to see your rank.</p>
3878
+ <h3 style='margin-top:0;'>🏆 Clasificación en directo</h3>
3879
+ <p style='margin:0;'>Envía un modelo para ver tu posición.</p>
3869
3880
  </div>
3870
3881
  """
3871
3882
  )
3872
3883
 
3873
3884
  # KPI Card
3874
3885
  submission_feedback_display = gr.HTML(
3875
- "<p style='text-align:center; color:#6b7280; padding:20px 0;'>Submit your first model to get feedback!</p>"
3886
+ "<p style='text-align:center; color:#6b7280; padding:20px 0;'>¡Envía tu primer modelo para recibir una valoración!</p>"
3876
3887
  )
3877
3888
 
3878
3889
  # Inline Login Components (initially hidden)
3879
3890
  login_username = gr.Textbox(
3880
3891
  label="Username",
3881
- placeholder="Enter your modelshare.ai username",
3892
+ placeholder="Introduce tu nombre de usuario de modelshare.ai",
3882
3893
  visible=False
3883
3894
  )
3884
3895
  login_password = gr.Textbox(
3885
- label="Password",
3896
+ label="Contraseña",
3886
3897
  type="password",
3887
- placeholder="Enter your password",
3898
+ placeholder="Introduce tu contraseña",
3888
3899
  visible=False
3889
3900
  )
3890
3901
  login_submit = gr.Button(
@@ -3898,23 +3909,23 @@ def create_model_building_game_es_app(theme_primary_hue: str = "indigo") -> "gr.
3898
3909
  )
3899
3910
 
3900
3911
  with gr.Tabs():
3901
- with gr.TabItem("Team Standings"):
3912
+ with gr.TabItem("Clasificación por equipos"):
3902
3913
  team_leaderboard_display = gr.HTML(
3903
3914
  "<p style='text-align:center; color:#6b7280; padding-top:20px;'>Submit a model to see team rankings.</p>"
3904
3915
  )
3905
- with gr.TabItem("Individual Standings"):
3916
+ with gr.TabItem("Clasificación individual"):
3906
3917
  individual_leaderboard_display = gr.HTML(
3907
- "<p style='text-align:center; color:#6b7280; padding-top:20px;'>Submit a model to see individual rankings.</p>"
3918
+ "<p style='text-align:center; color:#6b7280; padding-top:20px;'>Envía un modelo para ver la clasificación individual.</p>"
3908
3919
  )
3909
3920
 
3910
3921
  # REMOVED: Ethical Reminder HTML Block
3911
- step_2_next = gr.Button("Finish & Reflect ▶️", variant="secondary")
3922
+ step_2_next = gr.Button("Finalizar y reflexionar ▶️", variant="secondary")
3912
3923
 
3913
3924
  # Conclusion Step
3914
3925
  with gr.Column(visible=False, elem_id="conclusion-step") as conclusion_step:
3915
- gr.Markdown("<h1 style='text-align:center;'>✅ Section Complete</h1>")
3916
- final_score_display = gr.HTML(value="<p>Preparing final summary...</p>")
3917
- step_3_back = gr.Button("◀️ Back to Experiment")
3926
+ gr.Markdown("<h1 style='text-align:center;'>✅ Sección completada</h1>")
3927
+ final_score_display = gr.HTML(value="<p>Preparando el resumen final...</p>")
3928
+ step_3_back = gr.Button("◀️ Volver al experimento")
3918
3929
 
3919
3930
  # --- Navigation Logic ---
3920
3931
  all_steps_nav = [
@@ -4227,10 +4238,10 @@ def create_model_building_game_es_app(theme_primary_hue: str = "indigo") -> "gr.
4227
4238
 
4228
4239
  # Update submit button
4229
4240
  if ready:
4230
- submit_label = "5. 🔬 Build & Submit Model"
4241
+ submit_label = "5. 🔬 Construir y enviar el modelo"
4231
4242
  submit_interactive = True
4232
4243
  else:
4233
- submit_label = "⏳ Waiting for data..."
4244
+ submit_label = "⏳ Esperando datos..."
4234
4245
  submit_interactive = False
4235
4246
 
4236
4247
  # Get available data sizes based on init progress