Jesse-marqo commited on
Commit
56b01e3
1 Parent(s): 3ced6ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -11
app.py CHANGED
@@ -1,31 +1,43 @@
1
  import streamlit as st
2
  import pandas as pd
3
 
4
-
5
  def display_csv(file_path, columns_to_display):
6
  # Load the CSV file using pandas
7
  df = pd.read_csv(file_path)
 
8
  # Select only the specified columns
9
  df_selected_columns = df[columns_to_display].sort_values(by=['avg_score'], ascending=False).reset_index(drop=True)
 
10
  # Display the selected columns as a table
11
  st.dataframe(df_selected_columns, height=500, width=1000)
12
 
13
  def main():
14
- # Hardcoded file path
15
- file_path = "merged-averaged-model_timings_2.1.0_12.1_NVIDIA_A10G_False.csv"
 
 
16
  # Columns to display
17
  columns_to_display = [
18
- "model_name", "pretrained", "avg_score", "image_time", "text_time",
19
- "image_shape", "text_shape",
20
- "output shape",
21
  "params (M)", "FLOPs (B)"
22
- ] # Specify the columns you want to display
23
-
24
  # Add header and description
25
  st.header("CLIP benchmarks - retrieval and inference")
26
- st.write("CLIP benchmarks for inference and retrieval performance. Image size, context length and output dimensions are also included. Retrieval performance comes from https://github.com/mlfoundations/open_clip/blob/main/docs/openclip_retrieval_results.csv.Tested with A10G, CUDA 12.1, Torch 2.1.0")
27
-
28
- # Call the display_csv function with the hardcoded file path and selected columns
 
 
 
 
 
 
 
 
 
29
  display_csv(file_path, columns_to_display)
30
 
31
  # Custom CSS to make the app full screen
 
1
  import streamlit as st
2
  import pandas as pd
3
 
 
4
  def display_csv(file_path, columns_to_display):
5
  # Load the CSV file using pandas
6
  df = pd.read_csv(file_path)
7
+
8
  # Select only the specified columns
9
  df_selected_columns = df[columns_to_display].sort_values(by=['avg_score'], ascending=False).reset_index(drop=True)
10
+
11
  # Display the selected columns as a table
12
  st.dataframe(df_selected_columns, height=500, width=1000)
13
 
14
  def main():
15
+ # Hardcoded file paths
16
+ file_path1 = "merged-averaged-model_timings_2.1.0_12.1_NVIDIA_A10G_False.csv"
17
+ file_path2 = "merged-averaged-model_timings_2.1.0_12.1_Tesla_T4_False.csv" # Replace with the path to your second CSV file
18
+
19
  # Columns to display
20
  columns_to_display = [
21
+ "model_name", "pretrained", "avg_score", "image_time", "text_time",
22
+ "image_shape", "text_shape",
23
+ "output shape",
24
  "params (M)", "FLOPs (B)"
25
+ ]
26
+
27
  # Add header and description
28
  st.header("CLIP benchmarks - retrieval and inference")
29
+ st.write("CLIP benchmarks for inference and retrieval performance. Image size, context length and output dimensions are also included. Retrieval performance comes from https://github.com/mlfoundations/open_clip/blob/main/docs/openclip_retrieval_results.csv. Tested with A10G, CUDA 12.1, Torch 2.1.0")
30
+
31
+ # Add radio button to select the CSV file
32
+ selected_file = st.radio("Select results for a specific GPU", ("GPU: A10g", "GPU: T4"))
33
+
34
+ # Determine the file path based on the selected file
35
+ if selected_file == "GPU: A10g":
36
+ file_path = file_path1
37
+ else:
38
+ file_path = file_path2
39
+
40
+ # Call the display_csv function with the selected file path and columns
41
  display_csv(file_path, columns_to_display)
42
 
43
  # Custom CSS to make the app full screen