magilogi
commited on
Commit
·
697b3ec
1
Parent(s):
56ee763
new plots
Browse files
app.py
CHANGED
|
@@ -65,6 +65,13 @@ def create_scatter_plot(df, x_col, y_col, title, x_title, y_title):
|
|
| 65 |
fig.update_traces(marker=dict(size=10), selector=dict(mode='markers'))
|
| 66 |
return fig
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
with gr.Blocks(css="custom.css") as demo:
|
| 69 |
with gr.Column():
|
| 70 |
gr.Markdown(
|
|
@@ -204,6 +211,15 @@ with gr.Blocks(css="custom.css") as demo:
|
|
| 204 |
</div>""",
|
| 205 |
elem_classes="markdown-text"
|
| 206 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
|
| 208 |
if __name__ == "__main__":
|
| 209 |
demo.launch()
|
|
|
|
| 65 |
fig.update_traces(marker=dict(size=10), selector=dict(mode='markers'))
|
| 66 |
return fig
|
| 67 |
|
| 68 |
+
|
| 69 |
+
def create_bar_plot(df, col, title):
|
| 70 |
+
sorted_df = df.sort_values(by=col, ascending=True)
|
| 71 |
+
fig = px.bar(sorted_df, x=col, y='Model', orientation='h', title=title)
|
| 72 |
+
fig.update_layout(xaxis_title=col, yaxis_title='Model')
|
| 73 |
+
return fig
|
| 74 |
+
|
| 75 |
with gr.Blocks(css="custom.css") as demo:
|
| 76 |
with gr.Column():
|
| 77 |
gr.Markdown(
|
|
|
|
| 211 |
</div>""",
|
| 212 |
elem_classes="markdown-text"
|
| 213 |
)
|
| 214 |
+
with gr.Row():
|
| 215 |
+
bar1 = gr.Plot(
|
| 216 |
+
value=create_bar_plot(df, "medmcqa_diff", "MedMCQA Difference Sorted"),
|
| 217 |
+
elem_id="bar1"
|
| 218 |
+
)
|
| 219 |
+
bar2 = gr.Plot(
|
| 220 |
+
value=create_bar_plot(df, "medqa_diff", "MedQA Difference Sorted"),
|
| 221 |
+
elem_id="bar2"
|
| 222 |
+
)
|
| 223 |
|
| 224 |
if __name__ == "__main__":
|
| 225 |
demo.launch()
|