piotr-szleg-bards-ai commited on
Commit
15822f7
1 Parent(s): 8980b16

2024-03-15 14:12:25 Publish script update

Browse files
Files changed (3) hide show
  1. app.py +11 -5
  2. app_constants.py +2 -2
  3. data/combined_plots.csv +0 -0
app.py CHANGED
@@ -10,6 +10,7 @@ from pandas.api.types import is_numeric_dtype
10
 
11
  from pipeline.config import LLMBoardConfig, QueriesConfig
12
  from app_constants import README, JS, TIME_PERIODS_EXPLANATION_DF
 
13
 
14
  queries_config = QueriesConfig()
15
 
@@ -134,9 +135,11 @@ def display_plot(plot_df_row):
134
  def display_filtered_plot(plot_df_row):
135
  row = dict(plot_df_row)
136
  plot_element, plot = display_plot(plot_df_row)
137
- plots.append((plot_element, plot, row))
138
  if "description" in row and pd.notna(row["description"]):
139
- gr.Markdown(str(row["description"]))
 
 
 
140
 
141
  def filter_plots(searched_query: str):
142
  searched_model_names = searched_query.split("|")
@@ -144,7 +147,7 @@ def filter_plots(searched_query: str):
144
  searched_model_names = [n for n in searched_model_names if n]
145
 
146
  results = []
147
- for plot_display, plot, row in plots:
148
  visible = True
149
  if "df" in row and pd.notna(row["df"]):
150
  buffer = io.StringIO(row["df"])
@@ -162,6 +165,9 @@ def filter_plots(searched_query: str):
162
  visible = False
163
 
164
  results.append(gr.Plot(plot, visible=visible))
 
 
 
165
 
166
  return results
167
 
@@ -296,13 +302,13 @@ To compare the parameters more thoroughly use the filtering box on top of this p
296
  filter_button.click(
297
  fn=filter_plots,
298
  inputs=filter_textbox,
299
- outputs=[v[0] for v in plots],
300
  api_name="filter_plots",
301
  )
302
  filter_textbox.submit(
303
  fn=filter_plots,
304
  inputs=filter_textbox,
305
- outputs=[v[0] for v in plots],
306
  api_name="filter_plots",
307
  )
308
  collapse_languages_button.click(
 
10
 
11
  from pipeline.config import LLMBoardConfig, QueriesConfig
12
  from app_constants import README, JS, TIME_PERIODS_EXPLANATION_DF
13
+ from itertools import chain
14
 
15
  queries_config = QueriesConfig()
16
 
 
135
  def display_filtered_plot(plot_df_row):
136
  row = dict(plot_df_row)
137
  plot_element, plot = display_plot(plot_df_row)
 
138
  if "description" in row and pd.notna(row["description"]):
139
+ description_element = gr.Markdown(str(row["description"]))
140
+ else:
141
+ description_element = gr.Markdown(value="", visible=False)
142
+ plots.append((plot_element, description_element, plot, row))
143
 
144
  def filter_plots(searched_query: str):
145
  searched_model_names = searched_query.split("|")
 
147
  searched_model_names = [n for n in searched_model_names if n]
148
 
149
  results = []
150
+ for plot_display, description_element, plot, row in plots:
151
  visible = True
152
  if "df" in row and pd.notna(row["df"]):
153
  buffer = io.StringIO(row["df"])
 
165
  visible = False
166
 
167
  results.append(gr.Plot(plot, visible=visible))
168
+ if not description_element.value:
169
+ visible = False
170
+ results.append(gr.Markdown(visible=visible))
171
 
172
  return results
173
 
 
302
  filter_button.click(
303
  fn=filter_plots,
304
  inputs=filter_textbox,
305
+ outputs=list(chain.from_iterable([v[0:2] for v in plots])),
306
  api_name="filter_plots",
307
  )
308
  filter_textbox.submit(
309
  fn=filter_plots,
310
  inputs=filter_textbox,
311
+ outputs=list(chain.from_iterable([v[0:2] for v in plots])),
312
  api_name="filter_plots",
313
  )
314
  collapse_languages_button.click(
app_constants.py CHANGED
@@ -2,10 +2,10 @@ import pandas as pd
2
 
3
  README = """
4
  This project compares different large language models and their providers for real time applications and mass data processing.
5
- While other benchmarks compare LLMs on different human intelligence tasks this benchmark focus on features related to business and engineering aspects such as response times, pricing and data streaming capabilities.
6
 
7
  To preform evaluation we chose a task of newspaper articles summarization from [GEM/xlsum](https://huggingface.co/datasets/GEM/xlsum) dataset as it represents a very standard type of task where model has to understand unstructured natural language text, process it and output text in a specified format.
8
- For this version we chose English, Ukrainian and Japanese languages, with Japanese representing languages using logographic alphabets. This enable us also validate the effectiveness of the LLM for different language groups.
9
 
10
  Each of the models was asked to summarize the text using the following prompt:
11
 
 
2
 
3
  README = """
4
  This project compares different large language models and their providers for real time applications and mass data processing.
5
+ While other benchmarks compare LLMs on different human intelligence tasks this benchmark focuses on features related to business and engineering aspects such as response times, pricing and data streaming capabilities.
6
 
7
  To preform evaluation we chose a task of newspaper articles summarization from [GEM/xlsum](https://huggingface.co/datasets/GEM/xlsum) dataset as it represents a very standard type of task where model has to understand unstructured natural language text, process it and output text in a specified format.
8
+ For this version we chose English, Ukrainian and Japanese languages, with Japanese representing languages using logographic alphabets. This enables us to also validate the effectiveness of the LLM for different language groups.
9
 
10
  Each of the models was asked to summarize the text using the following prompt:
11
 
data/combined_plots.csv CHANGED
The diff for this file is too large to render. See raw diff