Steveeeeeeen HF staff commited on
Commit
3ea6f44
1 Parent(s): c59b8e7

Fix Gradio Dataframe headers (#24)

Browse files

- Apply 'white-space: nowrap' to Dataframe headers to prevent text wrapping (a81e2d5663659853e6858434c51db3f29d93ea69)

Files changed (2) hide show
  1. app.py +2 -2
  2. constants.py +6 -0
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
  import pandas as pd
3
  import json
4
- from constants import BANNER, INTRODUCTION_TEXT, CITATION_TEXT, METRICS_TAB_TEXT, DIR_OUTPUT_REQUESTS
5
  from init import is_model_on_hub, upload_file, load_all_info_from_dataset_hub
6
  from utils_display import AutoEvalColumn, fields, make_clickable_model, styled_error, styled_message
7
  from datetime import datetime, timezone
@@ -102,7 +102,7 @@ def request_model(model_text, chbcoco2017):
102
  except Exception as e:
103
  return styled_error(f"Error submitting request!")
104
 
105
- with gr.Blocks() as demo:
106
  gr.HTML(BANNER, elem_id="banner")
107
  gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
108
 
 
1
  import gradio as gr
2
  import pandas as pd
3
  import json
4
+ from constants import BANNER, INTRODUCTION_TEXT, CITATION_TEXT, METRICS_TAB_TEXT, DIR_OUTPUT_REQUESTS, LEADERBOARD_CSS
5
  from init import is_model_on_hub, upload_file, load_all_info_from_dataset_hub
6
  from utils_display import AutoEvalColumn, fields, make_clickable_model, styled_error, styled_message
7
  from datetime import datetime, timezone
 
102
  except Exception as e:
103
  return styled_error(f"Error submitting request!")
104
 
105
+ with gr.Blocks(css=LEADERBOARD_CSS) as demo:
106
  gr.HTML(BANNER, elem_id="banner")
107
  gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
108
 
constants.py CHANGED
@@ -113,3 +113,9 @@ are ranked based on their average WER scores, from lowest to highest.
113
 
114
  For more details on the individual datasets and how models are evaluated to give the ESB score, refer to the [ESB paper](https://arxiv.org/abs/2210.13352).
115
  """
 
 
 
 
 
 
 
113
 
114
  For more details on the individual datasets and how models are evaluated to give the ESB score, refer to the [ESB paper](https://arxiv.org/abs/2210.13352).
115
  """
116
+
117
+ LEADERBOARD_CSS = """
118
+ #leaderboard-table th .header-content {
119
+ white-space: nowrap;
120
+ }
121
+ """