Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,25 +1,41 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
|
|
|
| 3 |
|
| 4 |
# Title of the app
|
| 5 |
st.title('OpenCLIP Model Results Viewer')
|
| 6 |
|
| 7 |
-
# Displaying the
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
csv_file_path = 'openclip_multilingual_retrieval_results.csv'
|
| 9 |
|
| 10 |
try:
|
|
|
|
| 11 |
df = pd.read_csv(csv_file_path)
|
| 12 |
|
| 13 |
# Display the dataframe
|
| 14 |
st.write("### OpenCLIP Model Results")
|
| 15 |
st.dataframe(df)
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
|
| 19 |
-
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
|
| 23 |
-
|
|
|
|
| 24 |
except FileNotFoundError:
|
| 25 |
-
st.error(f"File {csv_file_path} not found. Please ensure the file exists in the app directory.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
| 3 |
+
import os
|
| 4 |
|
| 5 |
# Title of the app
|
| 6 |
st.title('OpenCLIP Model Results Viewer')
|
| 7 |
|
| 8 |
+
# Displaying the current working directory
|
| 9 |
+
st.write(f"Current working directory: {os.getcwd()}")
|
| 10 |
+
|
| 11 |
+
# List files in the current directory
|
| 12 |
+
st.write("Files in the current directory:")
|
| 13 |
+
st.write(os.listdir())
|
| 14 |
+
|
| 15 |
+
# Specify the CSV file path
|
| 16 |
csv_file_path = 'openclip_multilingual_retrieval_results.csv'
|
| 17 |
|
| 18 |
try:
|
| 19 |
+
# Attempt to read the CSV file
|
| 20 |
df = pd.read_csv(csv_file_path)
|
| 21 |
|
| 22 |
# Display the dataframe
|
| 23 |
st.write("### OpenCLIP Model Results")
|
| 24 |
st.dataframe(df)
|
| 25 |
|
| 26 |
+
# Optionally, you could add some visualizations or summaries
|
| 27 |
+
st.write("### Summary Statistics")
|
| 28 |
+
st.write(df.describe())
|
| 29 |
|
| 30 |
+
# If you want to create any specific plots
|
| 31 |
+
if st.checkbox("Show Plot"):
|
| 32 |
+
st.line_chart(df)
|
| 33 |
+
|
| 34 |
except FileNotFoundError:
|
| 35 |
+
st.error(f"File {csv_file_path} not found. Please ensure the file exists in the app directory.")
|
| 36 |
+
except pd.errors.EmptyDataError:
|
| 37 |
+
st.error(f"The file {csv_file_path} is empty. Please check the content of your CSV file.")
|
| 38 |
+
except pd.errors.ParserError:
|
| 39 |
+
st.error(f"Unable to parse {csv_file_path}. Please ensure it's a valid CSV file.")
|
| 40 |
+
except Exception as e:
|
| 41 |
+
st.error(f"An unexpected error occurred: {str(e)}")
|