apsys commited on
Commit
6f09c54
·
1 Parent(s): 26bf091

style theme

Browse files
Files changed (1) hide show
  1. app.py +22 -21
app.py CHANGED
@@ -275,7 +275,8 @@ def init_leaderboard(dataframe, visible_columns=None):
275
  for col in numeric_cols:
276
  # Avoid rounding integer columns like counts
277
  if not pd.api.types.is_integer_dtype(display_df[col]):
278
- display_df[col] = display_df[col].round(3)
 
279
 
280
  return gr.Dataframe(
281
  value=display_df,
@@ -861,26 +862,26 @@ with demo:
861
  outputs=[leaderboard] + [category_tabs.children[i].children[0] for i in range(1, len(CATEGORIES) + 1)]
862
  )
863
 
864
- with gr.Row():
865
- with gr.Column():
866
- gr.Textbox(
867
- value=CITATION_BUTTON_TEXT,
868
- label="Cite",
869
- lines=8,
870
- elem_id="citation-button",
871
- show_copy_button=True,
872
- )
873
-
874
- # with gr.Accordion("Dataset Information", open=False):
875
- with gr.Column():
876
- gr.Textbox(
877
- value=f"""
878
- https://huggingface.co/datasets/{RESULTS_DATASET_ID}
879
-
880
- Last updated: {pd.Timestamp.now().strftime("%Y-%m-%d %H:%M:%S UTC")}
881
- """,
882
- lines=8,
883
- label="Results:")
884
 
885
  # Set up the scheduler to refresh data periodically
886
  scheduler = BackgroundScheduler()
 
275
  for col in numeric_cols:
276
  # Avoid rounding integer columns like counts
277
  if not pd.api.types.is_integer_dtype(display_df[col]):
278
+ # Format floats to exactly 3 decimal places, preserving trailing zeros
279
+ display_df[col] = display_df[col].apply(lambda x: f"{x:.3f}" if pd.notna(x) else None)
280
 
281
  return gr.Dataframe(
282
  value=display_df,
 
862
  outputs=[leaderboard] + [category_tabs.children[i].children[0] for i in range(1, len(CATEGORIES) + 1)]
863
  )
864
 
865
+ # with gr.Row():
866
+ # with gr.Column():
867
+ # gr.Textbox(
868
+ # value=CITATION_BUTTON_TEXT,
869
+ # label="Cite",
870
+ # lines=8,
871
+ # elem_id="citation-button",
872
+ # show_copy_button=True,
873
+ # )
874
+
875
+ # # with gr.Accordion("Dataset Information", open=False):
876
+ # with gr.Column():
877
+ # gr.Textbox(
878
+ # value=f"""
879
+ # https://huggingface.co/datasets/{RESULTS_DATASET_ID}
880
+
881
+ # Last updated: {pd.Timestamp.now().strftime("%Y-%m-%d %H:%M:%S UTC")}
882
+ # """,
883
+ # lines=8,
884
+ # label="Results:")
885
 
886
  # Set up the scheduler to refresh data periodically
887
  scheduler = BackgroundScheduler()