kz209 commited on
Commit
f6590f0
β€’
1 Parent(s): 5f1ff35
pages/arena.py CHANGED
@@ -6,6 +6,7 @@ import json
6
  from utils.data import dataset
7
  from utils.multiple_stream import stream_data
8
  from pages.summarization_playground import get_model_batch_generation
 
9
 
10
  def random_data_selection():
11
  datapoint = random.choice(dataset)
@@ -18,7 +19,7 @@ def create_arena():
18
  json_data = file.read()
19
  prompts = json.loads(json_data)
20
 
21
- with gr.Blocks() as demo:
22
  with gr.Group():
23
  datapoint = random_data_selection()
24
  gr.Markdown("""This arena is designed to compare different prompts. Click the button to stream responses from randomly shuffled prompts. Each column represents a response generated from one randomly selected prompt.
 
6
  from utils.data import dataset
7
  from utils.multiple_stream import stream_data
8
  from pages.summarization_playground import get_model_batch_generation
9
+ from pages.summarization_playground import custom_css
10
 
11
  def random_data_selection():
12
  datapoint = random.choice(dataset)
 
19
  json_data = file.read()
20
  prompts = json.loads(json_data)
21
 
22
+ with gr.Blocks(theme=gr.themes.Soft(spacing_size="sm",text_size="sm"), css=custom_css) as demo:
23
  with gr.Group():
24
  datapoint = random_data_selection()
25
  gr.Markdown("""This arena is designed to compare different prompts. Click the button to stream responses from randomly shuffled prompts. Each column represents a response generated from one randomly selected prompt.
pages/batch_evaluation.py CHANGED
@@ -11,6 +11,7 @@ from utils.model import Model
11
  from utils.metric import metric_rouge_score
12
 
13
  from pages.summarization_playground import generate_answer
 
14
 
15
  load_dotenv()
16
 
@@ -83,7 +84,7 @@ def process(model_selection, prompt, num=10):
83
 
84
 
85
  def create_batch_evaluation_interface():
86
- with gr.Blocks() as demo:
87
  gr.Markdown("## Here are evaluation setups. It will run though datapoints in test_data.josn to generate and evaluate. Show results once finished.")
88
 
89
  model_dropdown = gr.Dropdown(choices=Model.__model_list__, label="Choose a model", value=Model.__model_list__[0])
 
11
  from utils.metric import metric_rouge_score
12
 
13
  from pages.summarization_playground import generate_answer
14
+ from pages.summarization_playground import custom_css
15
 
16
  load_dotenv()
17
 
 
84
 
85
 
86
  def create_batch_evaluation_interface():
87
+ with gr.Blocks(theme=gr.themes.Soft(spacing_size="sm",text_size="sm"), css=custom_css) as demo:
88
  gr.Markdown("## Here are evaluation setups. It will run though datapoints in test_data.josn to generate and evaluate. Show results once finished.")
89
 
90
  model_dropdown = gr.Dropdown(choices=Model.__model_list__, label="Choose a model", value=Model.__model_list__[0])
pages/leaderboard.py CHANGED
@@ -1,6 +1,8 @@
1
  import gradio as gr
2
  import pandas as pd
3
 
 
 
4
  # Sample data for the leaderboard
5
  data = {
6
  'Rank': [1, 2, 3, 4, 5],
@@ -31,7 +33,7 @@ def update_leaderboard(sort_by):
31
  return html
32
 
33
  def create_leaderboard():
34
- with gr.Blocks(css="#leaderboard table { width: 100%; } #leaderboard th, #leaderboard td { padding: 8px; text-align: left; }") as demo:
35
  gr.Markdown("# πŸ† Summarization Arena Leaderboard")
36
 
37
  with gr.Row():
 
1
  import gradio as gr
2
  import pandas as pd
3
 
4
+ from pages.summarization_playground import custom_css
5
+
6
  # Sample data for the leaderboard
7
  data = {
8
  'Rank': [1, 2, 3, 4, 5],
 
33
  return html
34
 
35
  def create_leaderboard():
36
+ with gr.Blocks(theme=gr.themes.Soft(spacing_size="sm",text_size="sm"), css=custom_css) as demo:
37
  gr.Markdown("# πŸ† Summarization Arena Leaderboard")
38
 
39
  with gr.Row():