Spaces:
Sleeping
Sleeping
kz209
commited on
Commit
β’
c52847e
1
Parent(s):
bd19242
update
Browse files- pages/leaderboard.py +1 -1
- pages/summarization_playground.py +19 -2
pages/leaderboard.py
CHANGED
@@ -32,7 +32,7 @@ def update_leaderboard(sort_by):
|
|
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("# π
|
36 |
|
37 |
with gr.Row():
|
38 |
gr.Markdown("[Blog](placeholder) | [GitHub](placeholder) | [Paper](placeholder) | [Dataset](placeholder) | [Twitter](placeholder) | [Discord](placeholder)")
|
|
|
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():
|
38 |
gr.Markdown("[Blog](placeholder) | [GitHub](placeholder) | [Paper](placeholder) | [Dataset](placeholder) | [Twitter](placeholder) | [Discord](placeholder)")
|
pages/summarization_playground.py
CHANGED
@@ -75,7 +75,7 @@ def update_input(example):
|
|
75 |
return examples[example]
|
76 |
|
77 |
def create_summarization_interface():
|
78 |
-
with gr.Blocks() as demo:
|
79 |
gr.Markdown("## This is a playground to test prompts for clinical dialogue summarizations")
|
80 |
|
81 |
with gr.Row():
|
@@ -86,7 +86,24 @@ def create_summarization_interface():
|
|
86 |
datapoint = random.choice(dataset)
|
87 |
input_text = gr.Textbox(label="Input Dialogue", lines=10, placeholder="Enter text here...", value=datapoint['section_text'] + '\n\nDialogue:\n' + datapoint['dialogue'])
|
88 |
submit_button = gr.Button("β¨ Submit β¨")
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
|
91 |
example_dropdown.change(update_input, inputs=[example_dropdown], outputs=[input_text])
|
92 |
submit_button.click(process_input, inputs=[input_text, model_dropdown, Template_text], outputs=[output])
|
|
|
75 |
return examples[example]
|
76 |
|
77 |
def create_summarization_interface():
|
78 |
+
with gr.Blocks(theme=gr.themes.Soft(spacing_size="sm",text_size="sm")) as demo:
|
79 |
gr.Markdown("## This is a playground to test prompts for clinical dialogue summarizations")
|
80 |
|
81 |
with gr.Row():
|
|
|
86 |
datapoint = random.choice(dataset)
|
87 |
input_text = gr.Textbox(label="Input Dialogue", lines=10, placeholder="Enter text here...", value=datapoint['section_text'] + '\n\nDialogue:\n' + datapoint['dialogue'])
|
88 |
submit_button = gr.Button("β¨ Submit β¨")
|
89 |
+
|
90 |
+
with gr.Row():
|
91 |
+
with gr.Row():
|
92 |
+
with gr.Column():
|
93 |
+
gr.Markdown("<div style='border: 4px solid white; padding: 3px; border-radius: 5px;width:100px;padding-top: 0.5px;padding-bottom: 10px;'><h3>Prompt π₯</h3></center></div>")
|
94 |
+
prompt = gr.Textbox(label="Input", lines=6, placeholder = "Enter the Patient-Doctor conversation here.",elem_classes=["bordered-text"])
|
95 |
+
context = gr.Textbox(label="Context", placeholder="Enter relevant context about the patient medical history.",elem_classes="bordered-text")
|
96 |
+
token = gr.Textbox(label="Token",elem_classes="bordered-text")
|
97 |
+
with gr.Column():
|
98 |
+
gr.Markdown("<div style='border: 4px solid white; padding: 2px; border-radius: 5px;width:130px;padding-bottom: 10px;'><b><h3>Parameters π</h3></center></b></div>")
|
99 |
+
with gr.Column():
|
100 |
+
topK = gr.Textbox(label="TopP",elem_classes="bordered-text")
|
101 |
+
topP = gr.Textbox(label="TopK",elem_classes="bordered-text")
|
102 |
+
temperature = gr.Textbox(label="Temperature",elem_classes="parameter-text")
|
103 |
+
max_new_tokens = gr.Textbox(label="Max New Tokens",elem_classes="parameter-text")
|
104 |
+
do_sample = gr.Dropdown(['Default','None'],label="Do Sample",elem_classes="parameter-text")
|
105 |
+
return_text = gr.Dropdown(['Default','None'],label="Return Text",elem_classes="parameter-text")
|
106 |
+
output = gr.Markdown(line_breaks=True)
|
107 |
|
108 |
example_dropdown.change(update_input, inputs=[example_dropdown], outputs=[input_text])
|
109 |
submit_button.click(process_input, inputs=[input_text, model_dropdown, Template_text], outputs=[output])
|