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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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[':heart:'] = 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, ':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
@@ -128,7 +128,7 @@ def main():
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])
 
41
  api = HfApi()
42
 
43
  # Initialize new columns for likes and tags
44
+ df[''] = 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, ''] = model_info.likes
53
  df.loc[index, 'Tags'] = ', '.join(model_info.tags)
54
 
55
  except (RepositoryNotFoundError, RevisionNotFoundError):
56
+ df.loc[index, ''] = -1
57
  df.loc[index, 'Tags'] = ''
58
 
59
  return df
 
128
  df = df.sort_values(by='Average', ascending=False)
129
 
130
  # Display the DataFrame
131
+ st.dataframe(df[['Model'] + score_columns + ['']], use_container_width=True)
132
 
133
  # Full-width plot for the first category
134
  create_bar_chart(df, score_columns[0])