Spaces:
Running
Running
xiezhihui.x
commited on
Commit
·
293b74a
1
Parent(s):
58cd369
remove redundant entries
Browse files- data_reviewer.py +0 -14
data_reviewer.py
CHANGED
|
@@ -47,12 +47,6 @@ def load_and_display_sample(split, idx):
|
|
| 47 |
|
| 48 |
# Process JSON data
|
| 49 |
models = json.loads(sample["models"]) if isinstance(sample["models"], str) else sample["models"]
|
| 50 |
-
meta = json.loads(sample["meta"]) if isinstance(sample["meta"], str) else sample["meta"]
|
| 51 |
-
error_analysis = (
|
| 52 |
-
json.loads(sample["human_error_analysis"])
|
| 53 |
-
if isinstance(sample["human_error_analysis"], str)
|
| 54 |
-
else sample["human_error_analysis"]
|
| 55 |
-
)
|
| 56 |
|
| 57 |
return (
|
| 58 |
sample["image"], # image
|
|
@@ -63,9 +57,7 @@ def load_and_display_sample(split, idx):
|
|
| 63 |
sample["query_source"], # query_source
|
| 64 |
sample["query"], # query
|
| 65 |
json.dumps(models, indent=2), # models_json
|
| 66 |
-
json.dumps(meta, indent=2), # meta_json
|
| 67 |
sample["rationale"], # rationale
|
| 68 |
-
json.dumps(error_analysis, indent=2), # error_analysis_json
|
| 69 |
sample["ground_truth"], # ground_truth
|
| 70 |
f"Total samples: {len(dataset)}", # total_samples
|
| 71 |
)
|
|
@@ -114,15 +106,11 @@ def create_data_viewer():
|
|
| 114 |
with gr.Row(visible=not IGNORE_DETAILS):
|
| 115 |
with gr.Column():
|
| 116 |
models_json = gr.JSON(label="Models", value=json.loads(initial_data[7])) # Set initial models
|
| 117 |
-
meta_json = gr.JSON(label="Meta", value=json.loads(initial_data[8])) # Set initial meta
|
| 118 |
rationale = gr.TextArea(
|
| 119 |
label="Rationale", value=initial_data[9], interactive=False # Set initial rationale
|
| 120 |
)
|
| 121 |
|
| 122 |
with gr.Column():
|
| 123 |
-
error_analysis_json = gr.JSON(
|
| 124 |
-
label="Human Error Analysis", value=json.loads(initial_data[10]) # Set initial error analysis
|
| 125 |
-
)
|
| 126 |
ground_truth = gr.TextArea(
|
| 127 |
label="Ground Truth", value=initial_data[11], interactive=False # Set initial ground truth
|
| 128 |
)
|
|
@@ -141,9 +129,7 @@ def create_data_viewer():
|
|
| 141 |
query_source,
|
| 142 |
query,
|
| 143 |
models_json,
|
| 144 |
-
meta_json,
|
| 145 |
rationale,
|
| 146 |
-
error_analysis_json,
|
| 147 |
ground_truth,
|
| 148 |
total_samples,
|
| 149 |
],
|
|
|
|
| 47 |
|
| 48 |
# Process JSON data
|
| 49 |
models = json.loads(sample["models"]) if isinstance(sample["models"], str) else sample["models"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
return (
|
| 52 |
sample["image"], # image
|
|
|
|
| 57 |
sample["query_source"], # query_source
|
| 58 |
sample["query"], # query
|
| 59 |
json.dumps(models, indent=2), # models_json
|
|
|
|
| 60 |
sample["rationale"], # rationale
|
|
|
|
| 61 |
sample["ground_truth"], # ground_truth
|
| 62 |
f"Total samples: {len(dataset)}", # total_samples
|
| 63 |
)
|
|
|
|
| 106 |
with gr.Row(visible=not IGNORE_DETAILS):
|
| 107 |
with gr.Column():
|
| 108 |
models_json = gr.JSON(label="Models", value=json.loads(initial_data[7])) # Set initial models
|
|
|
|
| 109 |
rationale = gr.TextArea(
|
| 110 |
label="Rationale", value=initial_data[9], interactive=False # Set initial rationale
|
| 111 |
)
|
| 112 |
|
| 113 |
with gr.Column():
|
|
|
|
|
|
|
|
|
|
| 114 |
ground_truth = gr.TextArea(
|
| 115 |
label="Ground Truth", value=initial_data[11], interactive=False # Set initial ground truth
|
| 116 |
)
|
|
|
|
| 129 |
query_source,
|
| 130 |
query,
|
| 131 |
models_json,
|
|
|
|
| 132 |
rationale,
|
|
|
|
| 133 |
ground_truth,
|
| 134 |
total_samples,
|
| 135 |
],
|