mrfakename commited on
Commit
03d6969
1 Parent(s): a6e0994

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -319,7 +319,7 @@ def get_leaderboard(reveal_prelim: bool):
319
  cursor.execute(sql)
320
  data = cursor.fetchall()
321
  df = pd.DataFrame(data, columns=['name', 'upvote', 'downvote'])
322
- df['license'] = df['name'].map(model_license)
323
  df['name'] = df['name'].replace(model_names)
324
  df['votes'] = df['upvote'] + df['downvote']
325
  # df['score'] = round((df['upvote'] / df['votes']) * 100, 2) # Percentage score
@@ -340,7 +340,8 @@ def get_leaderboard(reveal_prelim: bool):
340
  df = df.sort_values(by='score', ascending=False)
341
  df['order'] = ['#' + str(i + 1) for i in range(len(df))]
342
  # df = df[['name', 'score', 'upvote', 'votes']]
343
- df = df[['order', 'name', 'score', 'license', 'votes']]
 
344
  return df
345
  def mkuuid(uid):
346
  if not uid:
@@ -448,7 +449,7 @@ def reload(chosenmodel1=None, chosenmodel2=None, userid=None, chose_a=False, cho
448
  with gr.Blocks() as leaderboard:
449
  gr.Markdown(LDESC)
450
  # df = gr.Dataframe(interactive=False, value=get_leaderboard())
451
- df = gr.Dataframe(interactive=False, min_width=0, wrap=True, column_widths=[30, 200, 50, 75, 50])
452
  with gr.Row():
453
  reveal_prelim = gr.Checkbox(label="Reveal Preliminary Results", info="Show all models, including models with very few human ratings.", scale=0)
454
  reloadbtn = gr.Button("Refresh")
 
319
  cursor.execute(sql)
320
  data = cursor.fetchall()
321
  df = pd.DataFrame(data, columns=['name', 'upvote', 'downvote'])
322
+ # df['license'] = df['name'].map(model_license)
323
  df['name'] = df['name'].replace(model_names)
324
  df['votes'] = df['upvote'] + df['downvote']
325
  # df['score'] = round((df['upvote'] / df['votes']) * 100, 2) # Percentage score
 
340
  df = df.sort_values(by='score', ascending=False)
341
  df['order'] = ['#' + str(i + 1) for i in range(len(df))]
342
  # df = df[['name', 'score', 'upvote', 'votes']]
343
+ # df = df[['order', 'name', 'score', 'license', 'votes']]
344
+ df = df[['order', 'name', 'score', 'votes']]
345
  return df
346
  def mkuuid(uid):
347
  if not uid:
 
449
  with gr.Blocks() as leaderboard:
450
  gr.Markdown(LDESC)
451
  # df = gr.Dataframe(interactive=False, value=get_leaderboard())
452
+ df = gr.Dataframe(interactive=False, min_width=0, wrap=True, column_widths=[30, 200, 50, 50])
453
  with gr.Row():
454
  reveal_prelim = gr.Checkbox(label="Reveal Preliminary Results", info="Show all models, including models with very few human ratings.", scale=0)
455
  reloadbtn = gr.Button("Refresh")