mlabonne commited on
Commit
328c0c0
1 Parent(s): e4fc9c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -22
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['tags'] = None
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['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 + ['Likes']], use_container_width=True)
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])