Jesse-marqo commited on
Commit
8dc2d0c
1 Parent(s): 1c86a95

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -7
app.py CHANGED
@@ -1,22 +1,41 @@
1
  import streamlit as st
2
  import pandas as pd
3
 
4
- def display_csv(file_path):
5
  # Load the CSV file using pandas
6
  df = pd.read_csv(file_path)
7
- # Display the dataframe as a table
8
- st.write(df, height=500, width=1000) # Adjust height and width as needed
 
 
9
 
10
  def main():
11
  # Hardcoded file path
12
  file_path = "merged-averaged-model_timings_2.1.0_12.1_NVIDIA_A10G_False.csv"
 
 
 
 
 
 
 
13
 
14
  # Add a text caption
15
- st.header("CLIP benchmarks - retrieval and inference")
16
- st.write("CLIP benchmarks for inference and retrieval performance. Image size, context length and output dimensions are also presented. A10G, CUDA 12.1, Torch 2.1.0")
 
 
 
17
 
18
- # Call the display_csv function with the hardcoded file path
19
- display_csv(file_path)
 
 
 
 
 
 
 
20
 
21
  if __name__ == "__main__":
22
  main()
 
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
+ # Select only the specified columns
8
+ df_selected_columns = df[columns_to_display]
9
+ # Display the selected columns as a table
10
+ st.write(df_selected_columns, height=500, width=1000, unsafe_allow_html=True)
11
 
12
  def main():
13
  # Hardcoded file path
14
  file_path = "merged-averaged-model_timings_2.1.0_12.1_NVIDIA_A10G_False.csv"
15
+ # Columns to display
16
+ columns_to_display = [
17
+ "model_name", "pretrained", "avg_score", "image_time", "text_time",
18
+ "image_shape", "text_shape",
19
+ "output shape",
20
+ "params (M)", "FLOPs (B)"
21
+ ] # Specify the columns you want to display
22
 
23
  # Add a text caption
24
+ st.header("CSV Viewer")
25
+ st.write("This app displays the contents of selected columns from a CSV file.")
26
+
27
+ # Call the display_csv function with the hardcoded file path and selected columns
28
+ display_csv(file_path, columns_to_display)
29
 
30
+ # Custom CSS to make the app full screen
31
+ st.markdown("""
32
+ <style>
33
+ .reportview-container {
34
+ width: 100%;
35
+ height: 100%;
36
+ }
37
+ </style>
38
+ """, unsafe_allow_html=True)
39
 
40
  if __name__ == "__main__":
41
  main()