mlabonne commited on
Commit
1cca6ff
·
verified ·
1 Parent(s): 1d13608

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -41,7 +41,7 @@ def get_model_info(df):
41
  api = HfApi()
42
 
43
  # Initialize new columns for likes and tags
44
- df['likes'] = None
45
  df['tags'] = None
46
 
47
  # Iterate through DataFrame rows
@@ -49,11 +49,11 @@ def get_model_info(df):
49
  model = row['Model'].strip()
50
  try:
51
  model_info = api.model_info(repo_id=str(model))
52
- df.loc[index, 'Likes'] = model_info.likes
53
  df.loc[index, 'Tags'] = ', '.join(model_info.tags)
54
 
55
  except (RepositoryNotFoundError, RevisionNotFoundError):
56
- df.loc[index, 'Likes'] = -1
57
  df.loc[index, 'Tags'] = ''
58
 
59
  return df
@@ -108,9 +108,9 @@ def main():
108
  # Toggles
109
  col1, col2 = st.columns(2)
110
  with col1:
111
- show_phi = st.toggle("Phi (2.8B)", value=True)
112
  with col2:
113
- show_mistral = st.toggle("Mistral (7B)", value=True)
114
 
115
  # Apply filters based on toggles
116
  if show_phi:
@@ -122,7 +122,7 @@ def main():
122
  df = df.sort_values(by='Average', ascending=False)
123
 
124
  # Display the DataFrame
125
- st.dataframe(df[['Model'] + score_columns + ['Likes']], use_container_width=True)
126
 
127
  # Full-width plot for the first category
128
  create_bar_chart(df, score_columns[0])
 
41
  api = HfApi()
42
 
43
  # Initialize new columns for likes and tags
44
+ df[':heart:'] = None
45
  df['tags'] = None
46
 
47
  # Iterate through DataFrame rows
 
49
  model = row['Model'].strip()
50
  try:
51
  model_info = api.model_info(repo_id=str(model))
52
+ df.loc[index, ':heart:'] = model_info.likes
53
  df.loc[index, 'Tags'] = ', '.join(model_info.tags)
54
 
55
  except (RepositoryNotFoundError, RevisionNotFoundError):
56
+ df.loc[index, ':heart:'] = -1
57
  df.loc[index, 'Tags'] = ''
58
 
59
  return df
 
108
  # Toggles
109
  col1, col2 = st.columns(2)
110
  with col1:
111
+ show_phi = st.checkbox("Phi (2.8B)", value=True)
112
  with col2:
113
+ show_mistral = st.checkbox("Mistral (7B)", value=True)
114
 
115
  # Apply filters based on toggles
116
  if show_phi:
 
122
  df = df.sort_values(by='Average', ascending=False)
123
 
124
  # Display the DataFrame
125
+ st.dataframe(df[['Model'] + score_columns + [':heart:']], use_container_width=True)
126
 
127
  # Full-width plot for the first category
128
  create_bar_chart(df, score_columns[0])