Update app.py
Browse files
app.py
CHANGED
@@ -42,7 +42,7 @@ def get_model_info(df):
|
|
42 |
|
43 |
# Initialize new columns for likes and tags
|
44 |
df[':heart:'] = None
|
45 |
-
df['
|
46 |
|
47 |
# Iterate through DataFrame rows
|
48 |
for index, row in df.iterrows():
|
@@ -103,33 +103,32 @@ def main():
|
|
103 |
# Corrected use of pd.to_numeric
|
104 |
full_df[col] = pd.to_numeric(full_df[col].str.strip(), errors='coerce')
|
105 |
full_df = get_model_info(full_df)
|
106 |
-
full_df['
|
107 |
df = pd.DataFrame(columns=full_df.columns)
|
108 |
|
109 |
-
#
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
|
123 |
-
#
|
124 |
-
|
125 |
-
|
126 |
|
127 |
-
#
|
128 |
-
|
129 |
|
130 |
-
#
|
131 |
-
|
132 |
-
st.dataframe(full_df, use_container_width=True)
|
133 |
|
134 |
# Full-width plot for the first category
|
135 |
create_bar_chart(df, score_columns[0])
|
|
|
42 |
|
43 |
# Initialize new columns for likes and tags
|
44 |
df[':heart:'] = None
|
45 |
+
df['Tags'] = None
|
46 |
|
47 |
# Iterate through DataFrame rows
|
48 |
for index, row in df.iterrows():
|
|
|
103 |
# Corrected use of pd.to_numeric
|
104 |
full_df[col] = pd.to_numeric(full_df[col].str.strip(), errors='coerce')
|
105 |
full_df = get_model_info(full_df)
|
106 |
+
full_df['Tags'] = full_df['Tags'].fillna('')
|
107 |
df = pd.DataFrame(columns=full_df.columns)
|
108 |
|
109 |
+
# Toggles
|
110 |
+
col1, col2 = st.columns(2)
|
111 |
+
with col1:
|
112 |
+
show_phi = st.checkbox("Phi (2.8B)", value=True)
|
113 |
+
with col2:
|
114 |
+
show_mistral = st.checkbox("Mistral (7B)", value=True)
|
115 |
+
|
116 |
+
dfs_to_concat = []
|
117 |
|
118 |
+
if show_phi:
|
119 |
+
dfs_to_concat.append(full_df[full_df['Tags'].str.lower().str.contains('phi-msft')])
|
120 |
+
if show_mistral:
|
121 |
+
dfs_to_concat.append(full_df[full_df['Tags'].str.lower().str.contains('mistral')])
|
122 |
|
123 |
+
# Concatenate the DataFrames
|
124 |
+
if dfs_to_concat:
|
125 |
+
df = pd.concat(dfs_to_concat, ignore_index=True)
|
126 |
|
127 |
+
# Sort values
|
128 |
+
df = df.sort_values(by='Average', ascending=False)
|
129 |
|
130 |
+
# Display the DataFrame
|
131 |
+
st.dataframe(df[['Model'] + score_columns + [':heart:']], use_container_width=True)
|
|
|
132 |
|
133 |
# Full-width plot for the first category
|
134 |
create_bar_chart(df, score_columns[0])
|