Spaces:
Running
Running
Update app.py
Browse files
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 |
-
#
|
| 8 |
-
|
|
|
|
|
|
|
| 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("
|
| 16 |
-
st.write("
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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()
|