Mollel commited on
Commit
1c32a9e
1 Parent(s): bda7c4e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -5,7 +5,7 @@ import re
5
 
6
  # Constants
7
  GITHUB_URL = "https://github.com/Sartify/STEL"
8
- NON_BENCHMARK_COLS = ["Open?", "Publisher", "Basemodel", "Matryoshka", "Dimension"]
9
 
10
  def extract_table_from_markdown(markdown_text, table_start):
11
  """Extract table content from markdown text."""
@@ -34,18 +34,21 @@ def setup_page():
34
  """Set up the Streamlit page."""
35
  st.set_page_config(page_title="Swahili Text Embeddings Leaderboard", page_icon="⚡", layout="wide")
36
  st.title("⚡ Swahili Text Embeddings Leaderboard (STEL)")
37
- st.image("STEL.jpg", width=300)
38
 
39
  def display_leaderboard(df):
40
  """Display the leaderboard."""
41
  st.header("📊 Leaderboard")
42
 
 
 
 
43
  # Add filters
44
- columns_to_filter = [col for col in df.columns if col not in NON_BENCHMARK_COLS]
45
  selected_columns = st.multiselect("Select benchmarks to display:", columns_to_filter, default=columns_to_filter)
46
 
47
  # Filter dataframe
48
- df_display = df[NON_BENCHMARK_COLS + selected_columns]
49
 
50
  # Display dataframe
51
  st.dataframe(df_display)
@@ -142,4 +145,6 @@ def main():
142
  st.markdown("Thank you for being part of this effort to advance Swahili language technologies!")
143
 
144
  if __name__ == "__main__":
145
- main()
 
 
 
5
 
6
  # Constants
7
  GITHUB_URL = "https://github.com/Sartify/STEL"
8
+ POSSIBLE_NON_BENCHMARK_COLS = ["Open?", "Publisher", "Basemodel", "Matryoshka", "Dimension", "Model Name"]
9
 
10
  def extract_table_from_markdown(markdown_text, table_start):
11
  """Extract table content from markdown text."""
 
34
  """Set up the Streamlit page."""
35
  st.set_page_config(page_title="Swahili Text Embeddings Leaderboard", page_icon="⚡", layout="wide")
36
  st.title("⚡ Swahili Text Embeddings Leaderboard (STEL)")
37
+ st.image("https://raw.githubusercontent.com/username/repo/main/STEL.jpg", width=300)
38
 
39
  def display_leaderboard(df):
40
  """Display the leaderboard."""
41
  st.header("📊 Leaderboard")
42
 
43
+ # Determine which non-benchmark columns are present
44
+ present_non_benchmark_cols = [col for col in POSSIBLE_NON_BENCHMARK_COLS if col in df.columns]
45
+
46
  # Add filters
47
+ columns_to_filter = [col for col in df.columns if col not in present_non_benchmark_cols]
48
  selected_columns = st.multiselect("Select benchmarks to display:", columns_to_filter, default=columns_to_filter)
49
 
50
  # Filter dataframe
51
+ df_display = df[present_non_benchmark_cols + selected_columns]
52
 
53
  # Display dataframe
54
  st.dataframe(df_display)
 
145
  st.markdown("Thank you for being part of this effort to advance Swahili language technologies!")
146
 
147
  if __name__ == "__main__":
148
+ main()
149
+
150
+