Bram Vanroy commited on
Commit
515327e
1 Parent(s): 7ca57b6

fix latex bold

Browse files
Files changed (1) hide show
  1. app.py +7 -9
app.py CHANGED
@@ -110,10 +110,7 @@ class ResultSet:
110
  @cached_property
111
  def df(self) -> DataFrame:
112
  data = [
113
- {
114
- col_name: getattr(result, attr)
115
- for attr, col_name in self.column_names.items()
116
- }
117
  for result in self.results
118
  ]
119
 
@@ -125,9 +122,11 @@ class ResultSet:
125
  def styled_df(self) -> Styler:
126
  data = [
127
  {
128
- col_name: (f"<a target='_blank' href='https://huggingface.co/{result.model_name}'"
129
- f" style='color: var(--link-text-color); text-decoration: underline;text-decoration-style:"
130
- f" dotted;'>{result.short_name}</a>")
 
 
131
  if attr == "short_name"
132
  else MODEL_TYPE_EMOJIS[result.model_type]
133
  if attr == "model_type"
@@ -161,7 +160,7 @@ class ResultSet:
161
  def highlight_max(col):
162
  return np.where(col == np.nanmax(col.to_numpy()), "font-weight: bold;", None)
163
 
164
- styler = styler.apply(highlight_max, axis=1, subset=number_cols)
165
  num_params_col = self.column_names["num_parameters"]
166
  styler = styler.format(convert_number_to_kmb, subset=num_params_col)
167
  styler = styler.hide()
@@ -261,7 +260,6 @@ with gr.Blocks() as demo:
261
  gr.Markdown("## LaTeX")
262
  gr.Code(results.latex_df.to_latex(convert_css=True))
263
 
264
-
265
  gr.Markdown(DISCLAIMER, elem_classes="markdown-text")
266
  gr.Markdown(CREDIT, elem_classes="markdown-text")
267
  gr.Markdown(CITATION, elem_classes="markdown-text")
 
110
  @cached_property
111
  def df(self) -> DataFrame:
112
  data = [
113
+ {col_name: getattr(result, attr) for attr, col_name in self.column_names.items()}
 
 
 
114
  for result in self.results
115
  ]
116
 
 
122
  def styled_df(self) -> Styler:
123
  data = [
124
  {
125
+ col_name: (
126
+ f"<a target='_blank' href='https://huggingface.co/{result.model_name}'"
127
+ f" style='color: var(--link-text-color); text-decoration: underline;text-decoration-style:"
128
+ f" dotted;'>{result.short_name}</a>"
129
+ )
130
  if attr == "short_name"
131
  else MODEL_TYPE_EMOJIS[result.model_type]
132
  if attr == "model_type"
 
160
  def highlight_max(col):
161
  return np.where(col == np.nanmax(col.to_numpy()), "font-weight: bold;", None)
162
 
163
+ styler = styler.apply(highlight_max, axis=0, subset=number_cols)
164
  num_params_col = self.column_names["num_parameters"]
165
  styler = styler.format(convert_number_to_kmb, subset=num_params_col)
166
  styler = styler.hide()
 
260
  gr.Markdown("## LaTeX")
261
  gr.Code(results.latex_df.to_latex(convert_css=True))
262
 
 
263
  gr.Markdown(DISCLAIMER, elem_classes="markdown-text")
264
  gr.Markdown(CREDIT, elem_classes="markdown-text")
265
  gr.Markdown(CITATION, elem_classes="markdown-text")