Spaces:
Running
Running
add emoji
Browse files- app.py +9 -9
- constants.py +1 -1
app.py
CHANGED
@@ -97,13 +97,13 @@ def sample_explore_item(model_name, size_H, size_W):
|
|
97 |
return "No item found", "No item found", "No item found", "No item found"
|
98 |
model_name = explore_item['Model']
|
99 |
example_id = explore_item['id']
|
100 |
-
puzzle_md = f"### Puzzle [{example_id}]:\n\n" + explore_item['puzzle'].replace("## Clues", "### Clues").replace("\n", "<br>")
|
101 |
-
model_reasoning_md = f"### {model_name}
|
102 |
-
model_prediction_md = f"### {model_name}
|
103 |
-
"\n\n" + explore_item['solution_table_md']
|
104 |
puzzle_solved = explore_item['correct_cells'] == explore_item['total_cells']
|
105 |
cell_acc = explore_item["correct_cells"] / explore_item["total_cells"] * 100
|
106 |
-
model_eval_md = f"### Evaluation:\n\n **Total Cells**: {explore_item['total_cells']} | **Correct Cells**: {explore_item['correct_cells']} | **Puzzle solved**: {puzzle_solved} | **Cell Acc**: {cell_acc:.2f}%"
|
107 |
return puzzle_md, model_reasoning_md, model_prediction_md, model_eval_md
|
108 |
|
109 |
|
@@ -121,10 +121,10 @@ def _tab_explore():
|
|
121 |
gr.Markdown("### π Click below to sample a puzzle. β¬οΈ ")
|
122 |
explore_button = gr.Button("π¦ Sample a Zebra Puzzle!", elem_id="explore-button")
|
123 |
|
124 |
-
puzzle_md = gr.Markdown("\n\nTo be loaded", elem_id="puzzle-md", elem_classes="box_md")
|
125 |
-
model_reasoning_md = gr.Markdown("\n\nTo be loaded", elem_id="model-reasoning-md", elem_classes="box_md")
|
126 |
-
model_prediction_md = gr.Markdown("\n\nTo be loaded", elem_id="model-prediction-md", elem_classes="box_md")
|
127 |
-
model_eval_md = gr.Markdown("\n\nTo be loaded", elem_id="model-eval-md", elem_classes="box_md")
|
128 |
|
129 |
explore_button.click(fn=sample_explore_item,
|
130 |
inputs=[model_selection, size_H_selection, size_W_selection],
|
|
|
97 |
return "No item found", "No item found", "No item found", "No item found"
|
98 |
model_name = explore_item['Model']
|
99 |
example_id = explore_item['id']
|
100 |
+
puzzle_md = f"### π¦ Puzzle [{example_id}]:\n\n" + explore_item['puzzle'].replace("## Clues:", "### **Clues:**").replace("\n", "<br>")
|
101 |
+
model_reasoning_md = f"### π€ Reasoning of {model_name}:\n\n {explore_item['reasoning']}"
|
102 |
+
model_prediction_md = f"### π¬ Answer of {model_name}:\n\n**Json format:** {str(explore_item['solution']).replace('___', 'null')}" + \
|
103 |
+
"\n\n**Table format:**\n" + explore_item['solution_table_md']
|
104 |
puzzle_solved = explore_item['correct_cells'] == explore_item['total_cells']
|
105 |
cell_acc = explore_item["correct_cells"] / explore_item["total_cells"] * 100
|
106 |
+
model_eval_md = f"### π Evaluation:\n\n **Total Cells**: {explore_item['total_cells']} | **Correct Cells**: {explore_item['correct_cells']} | **Puzzle solved**: {puzzle_solved} | **Cell Acc**: {cell_acc:.2f}%"
|
107 |
return puzzle_md, model_reasoning_md, model_prediction_md, model_eval_md
|
108 |
|
109 |
|
|
|
121 |
gr.Markdown("### π Click below to sample a puzzle. β¬οΈ ")
|
122 |
explore_button = gr.Button("π¦ Sample a Zebra Puzzle!", elem_id="explore-button")
|
123 |
|
124 |
+
puzzle_md = gr.Markdown("### π¦ Puzzle: \n\nTo be loaded", elem_id="puzzle-md", elem_classes="box_md")
|
125 |
+
model_reasoning_md = gr.Markdown("### π€ Reasoning: \n\nTo be loaded", elem_id="model-reasoning-md", elem_classes="box_md")
|
126 |
+
model_prediction_md = gr.Markdown("### π¬ Answer: \n\nTo be loaded", elem_id="model-prediction-md", elem_classes="box_md")
|
127 |
+
model_eval_md = gr.Markdown("### π Evaluation: \n\nTo be loaded", elem_id="model-eval-md", elem_classes="box_md")
|
128 |
|
129 |
explore_button.click(fn=sample_explore_item,
|
130 |
inputs=[model_selection, size_H_selection, size_W_selection],
|
constants.py
CHANGED
@@ -280,7 +280,7 @@ button.selected[role="tab"][aria-selected="true"] {
|
|
280 |
.box_md{
|
281 |
border: 1px solid #000000;
|
282 |
border-radius: 10px;
|
283 |
-
padding:
|
284 |
font-size: 12pt;
|
285 |
margin: 5px;
|
286 |
}
|
|
|
280 |
.box_md{
|
281 |
border: 1px solid #000000;
|
282 |
border-radius: 10px;
|
283 |
+
padding: 10px;
|
284 |
font-size: 12pt;
|
285 |
margin: 5px;
|
286 |
}
|