Quazim0t0 commited on
Commit
4c5c1ef
·
verified ·
1 Parent(s): 86876da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +73 -2
app.py CHANGED
@@ -23,40 +23,111 @@ evaluation_queue = EvaluationQueue(db, auth_manager)
23
  leaderboard = Leaderboard(db)
24
 
25
  # Initialize sample benchmarks if none exist
 
26
  benchmarks = db.get_benchmarks()
27
  if not benchmarks or len(benchmarks) == 0:
28
  print("No benchmarks found. Adding sample benchmarks...")
29
  try:
 
 
 
 
30
  num_added = add_sample_benchmarks()
31
  print(f"Added {num_added} sample benchmarks.")
32
  except Exception as e:
33
- print(f"Error adding sample benchmarks: {e}")
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
- # Custom CSS
36
  css = """
 
 
 
 
 
 
37
  .info-text {
38
  background-color: #f0f7ff;
39
  padding: 12px;
40
  border-radius: 8px;
41
  border-left: 4px solid #3498db;
42
  margin: 12px 0;
 
43
  }
44
 
 
45
  .container {
46
  max-width: 1200px;
47
  margin: 0 auto;
48
  }
49
 
 
50
  .header {
51
  text-align: center;
52
  margin-bottom: 20px;
 
53
  }
54
 
 
55
  .footer {
56
  text-align: center;
57
  margin-top: 40px;
58
  padding: 20px;
59
  border-top: 1px solid #eee;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  }
61
  """
62
 
 
23
  leaderboard = Leaderboard(db)
24
 
25
  # Initialize sample benchmarks if none exist
26
+ print("Checking for existing benchmarks...")
27
  benchmarks = db.get_benchmarks()
28
  if not benchmarks or len(benchmarks) == 0:
29
  print("No benchmarks found. Adding sample benchmarks...")
30
  try:
31
+ # Make sure the database path is clear
32
+ print(f"Database path: {db.db_path}")
33
+
34
+ # Import and call the function directly
35
  num_added = add_sample_benchmarks()
36
  print(f"Added {num_added} sample benchmarks.")
37
  except Exception as e:
38
+ print(f"Error adding sample benchmarks: {str(e)}")
39
+ # Try direct DB insertion as fallback
40
+ try:
41
+ print("Attempting direct benchmark insertion...")
42
+ db.add_benchmark(
43
+ name="MMLU (Massive Multitask Language Understanding)",
44
+ dataset_id="cais/mmlu",
45
+ description="Tests knowledge across 57 subjects"
46
+ )
47
+ print("Added fallback benchmark.")
48
+ except Exception as inner_e:
49
+ print(f"Fallback insertion failed: {str(inner_e)}")
50
+ else:
51
+ print(f"Found {len(benchmarks)} existing benchmarks.")
52
 
53
+ # Custom CSS with fixes for text visibility
54
  css = """
55
+ /* Fix for text visibility */
56
+ .gradio-container {
57
+ color: #333333 !important;
58
+ }
59
+
60
+ /* Fix for info boxes */
61
  .info-text {
62
  background-color: #f0f7ff;
63
  padding: 12px;
64
  border-radius: 8px;
65
  border-left: 4px solid #3498db;
66
  margin: 12px 0;
67
+ color: #222222 !important;
68
  }
69
 
70
+ /* Container styling */
71
  .container {
72
  max-width: 1200px;
73
  margin: 0 auto;
74
  }
75
 
76
+ /* Header styling */
77
  .header {
78
  text-align: center;
79
  margin-bottom: 20px;
80
+ color: #222222 !important;
81
  }
82
 
83
+ /* Footer styling */
84
  .footer {
85
  text-align: center;
86
  margin-top: 40px;
87
  padding: 20px;
88
  border-top: 1px solid #eee;
89
+ color: #222222 !important;
90
+ }
91
+
92
+ /* Fix for tab content */
93
+ .tab-content {
94
+ color: #222222 !important;
95
+ }
96
+
97
+ /* Fix for highlighted text areas */
98
+ .highlight-text {
99
+ background-color: #f0f7ff;
100
+ color: #333333;
101
+ }
102
+
103
+ /* Fix for dataframes */
104
+ table.dataframe {
105
+ color: #333333 !important;
106
+ }
107
+
108
+ /* Fix for dropdown text */
109
+ select, option {
110
+ color: #333333 !important;
111
+ }
112
+
113
+ /* Fix for button text */
114
+ button {
115
+ color: #ffffff !important;
116
+ }
117
+
118
+ /* Fix for input fields */
119
+ input, textarea {
120
+ color: #333333 !important;
121
+ }
122
+
123
+ /* General text fix */
124
+ p, h1, h2, h3, h4, h5, h6, span, div {
125
+ color: #333333 !important;
126
+ }
127
+
128
+ /* Ensure markdown is visible */
129
+ .markdown-text {
130
+ color: #333333 !important;
131
  }
132
  """
133