Mollel commited on
Commit
4a04f21
1 Parent(s): 00b7e99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -2
app.py CHANGED
@@ -54,7 +54,28 @@ def setup_page():
54
  """Set up the Streamlit page."""
55
  st.set_page_config(page_title="Swahili Text Embeddings Leaderboard", page_icon="⚡", layout="wide")
56
  st.title("⚡ Swahili Text Embeddings Leaderboard (STEL)")
57
- st.image("https://raw.githubusercontent.com/username/repo/main/STEL.jpg", width=300)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
 
59
  def display_leaderboard(df):
60
  """Display the leaderboard."""
@@ -71,12 +92,13 @@ def display_leaderboard(df):
71
  df_display = df[present_non_benchmark_cols + selected_columns]
72
 
73
  # Display dataframe
74
- st.dataframe(df_display.style.format("{:.4f}", subset=selected_columns))
75
 
76
  # Download buttons
77
  csv = df_display.to_csv(index=False)
78
  st.download_button(label="Download as CSV", data=csv, file_name="leaderboard.csv", mime="text/csv")
79
 
 
80
  # ... (rest of the code remains the same)
81
 
82
  def main():
 
54
  """Set up the Streamlit page."""
55
  st.set_page_config(page_title="Swahili Text Embeddings Leaderboard", page_icon="⚡", layout="wide")
56
  st.title("⚡ Swahili Text Embeddings Leaderboard (STEL)")
57
+ st.image("https://raw.githubusercontent.com/username/repo/main/files/STEL.jpg", width=300)
58
+
59
+ # def display_leaderboard(df):
60
+ # """Display the leaderboard."""
61
+ # st.header("📊 Leaderboard")
62
+
63
+ # # Determine which non-benchmark columns are present
64
+ # present_non_benchmark_cols = [col for col in POSSIBLE_NON_BENCHMARK_COLS if col in df.columns]
65
+
66
+ # # Add filters
67
+ # columns_to_filter = [col for col in df.columns if col not in present_non_benchmark_cols]
68
+ # selected_columns = st.multiselect("Select benchmarks to display:", columns_to_filter, default=columns_to_filter)
69
+
70
+ # # Filter dataframe
71
+ # df_display = df[present_non_benchmark_cols + selected_columns]
72
+
73
+ # # Display dataframe
74
+ # st.dataframe(df_display.style.format("{:.4f}", subset=selected_columns))
75
+
76
+ # # Download buttons
77
+ # csv = df_display.to_csv(index=False)
78
+ # st.download_button(label="Download as CSV", data=csv, file_name="leaderboard.csv", mime="text/csv")
79
 
80
  def display_leaderboard(df):
81
  """Display the leaderboard."""
 
92
  df_display = df[present_non_benchmark_cols + selected_columns]
93
 
94
  # Display dataframe
95
+ st.dataframe(df_display.style.format("{:.4f}", subset=[col for col in df_display.columns if df_display[col].dtype == 'float64']))
96
 
97
  # Download buttons
98
  csv = df_display.to_csv(index=False)
99
  st.download_button(label="Download as CSV", data=csv, file_name="leaderboard.csv", mime="text/csv")
100
 
101
+
102
  # ... (rest of the code remains the same)
103
 
104
  def main():