Spaces:
Runtime error
Runtime error
Update README.md
#1
by
clefourrier
HF staff
- opened
- README.md +2 -2
- app.py +12 -12
- content.py +2 -2
README.md
CHANGED
@@ -4,10 +4,10 @@ emoji: 🐨
|
|
4 |
colorFrom: purple
|
5 |
colorTo: blue
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 4.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: mit
|
11 |
---
|
12 |
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
4 |
colorFrom: purple
|
5 |
colorTo: blue
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 4.19.2
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: mit
|
11 |
---
|
12 |
|
13 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
CHANGED
@@ -17,7 +17,7 @@ from content import format_error, format_warning, format_log, TITLE, INTRODUCTIO
|
|
17 |
|
18 |
TOKEN = os.environ.get("TOKEN", None)
|
19 |
OWNER="ucla-contextual"
|
20 |
-
|
21 |
VAL_DATASET = f"{OWNER}/contextual_val"
|
22 |
SUBMISSION_DATASET = f"{OWNER}/submissions_internal"
|
23 |
CONTACT_DATASET = f"{OWNER}/contact_info"
|
@@ -38,13 +38,13 @@ def save_json_file(filepath, data_dict):
|
|
38 |
|
39 |
os.makedirs("scored", exist_ok=True)
|
40 |
|
41 |
-
|
42 |
-
|
43 |
|
44 |
val_data_files = {"val": "contextual_val.csv"}
|
45 |
val_dataset = load_dataset(VAL_DATASET, data_files=val_data_files , token=TOKEN, download_mode="force_redownload", ignore_verifications=True)
|
46 |
|
47 |
-
results_data_files = {"
|
48 |
results = load_dataset(RESULTS_DATASET, data_files=
|
49 |
results_data_files, token=TOKEN, download_mode="force_redownload", ignore_verifications=True)
|
50 |
|
@@ -57,13 +57,13 @@ def get_dataframe_from_results(results, split):
|
|
57 |
df = df.sort_values(by=["All"], ascending=False)
|
58 |
return df
|
59 |
|
60 |
-
|
61 |
val_dataset_dataframe = val_dataset["val"].to_pandas()
|
62 |
|
63 |
contacts_dataframe = contact_infos["contacts"].to_pandas()
|
64 |
|
65 |
val_results_dataframe = get_dataframe_from_results(results=results, split="val")
|
66 |
-
|
67 |
|
68 |
def restart_space():
|
69 |
api.restart_space(repo_id=LEADERBOARD_PATH, token=TOKEN)
|
@@ -197,12 +197,12 @@ def add_new_eval(
|
|
197 |
|
198 |
|
199 |
def refresh():
|
200 |
-
results_data_files = {"
|
201 |
results = load_dataset(RESULTS_DATASET, data_files=
|
202 |
results_data_files, token=TOKEN, download_mode="force_redownload", ignore_verifications=True)
|
203 |
val_results_dataframe = get_dataframe_from_results(results=results, split="val")
|
204 |
-
|
205 |
-
return val_results_dataframe,
|
206 |
|
207 |
def upload_file(files):
|
208 |
file_paths = [file.name for file in files]
|
@@ -230,8 +230,8 @@ with demo:
|
|
230 |
elem_id="citation-button",
|
231 |
)
|
232 |
with gr.Tab("Results: Test"):
|
233 |
-
|
234 |
-
value=
|
235 |
column_widths=["20%"]
|
236 |
)
|
237 |
with gr.Tab("Results: Val"):
|
@@ -246,7 +246,7 @@ with demo:
|
|
246 |
inputs=[],
|
247 |
outputs=[
|
248 |
leaderboard_table_val,
|
249 |
-
|
250 |
],
|
251 |
)
|
252 |
with gr.Accordion("Submit a new model for evaluation"):
|
|
|
17 |
|
18 |
TOKEN = os.environ.get("TOKEN", None)
|
19 |
OWNER="ucla-contextual"
|
20 |
+
ALL_DATASET = f"{OWNER}/contextual_all"
|
21 |
VAL_DATASET = f"{OWNER}/contextual_val"
|
22 |
SUBMISSION_DATASET = f"{OWNER}/submissions_internal"
|
23 |
CONTACT_DATASET = f"{OWNER}/contact_info"
|
|
|
38 |
|
39 |
os.makedirs("scored", exist_ok=True)
|
40 |
|
41 |
+
all_data_files = {"overall": "contextual_all.csv"}
|
42 |
+
all_dataset = load_dataset(ALL_DATASET, data_files=all_data_files , token=TOKEN, download_mode="force_redownload", ignore_verifications=True)
|
43 |
|
44 |
val_data_files = {"val": "contextual_val.csv"}
|
45 |
val_dataset = load_dataset(VAL_DATASET, data_files=val_data_files , token=TOKEN, download_mode="force_redownload", ignore_verifications=True)
|
46 |
|
47 |
+
results_data_files = {"overall": "contextual_all_results.csv", "val": "contextual_val_results.csv"}
|
48 |
results = load_dataset(RESULTS_DATASET, data_files=
|
49 |
results_data_files, token=TOKEN, download_mode="force_redownload", ignore_verifications=True)
|
50 |
|
|
|
57 |
df = df.sort_values(by=["All"], ascending=False)
|
58 |
return df
|
59 |
|
60 |
+
all_dataset_dataframe = all_dataset["overall"].to_pandas()
|
61 |
val_dataset_dataframe = val_dataset["val"].to_pandas()
|
62 |
|
63 |
contacts_dataframe = contact_infos["contacts"].to_pandas()
|
64 |
|
65 |
val_results_dataframe = get_dataframe_from_results(results=results, split="val")
|
66 |
+
all_results_dataframe = get_dataframe_from_results(results=results, split="overall")
|
67 |
|
68 |
def restart_space():
|
69 |
api.restart_space(repo_id=LEADERBOARD_PATH, token=TOKEN)
|
|
|
197 |
|
198 |
|
199 |
def refresh():
|
200 |
+
results_data_files = {"overall": "contextual_all_results.csv", "val": "contextual_val_results.csv"}
|
201 |
results = load_dataset(RESULTS_DATASET, data_files=
|
202 |
results_data_files, token=TOKEN, download_mode="force_redownload", ignore_verifications=True)
|
203 |
val_results_dataframe = get_dataframe_from_results(results=results, split="val")
|
204 |
+
all_results_dataframe = get_dataframe_from_results(results=results, split="overall")
|
205 |
+
return val_results_dataframe, all_results_dataframe
|
206 |
|
207 |
def upload_file(files):
|
208 |
file_paths = [file.name for file in files]
|
|
|
230 |
elem_id="citation-button",
|
231 |
)
|
232 |
with gr.Tab("Results: Test"):
|
233 |
+
leaderboard_table_all = gr.components.Dataframe(
|
234 |
+
value=all_results_dataframe, datatype=TYPES, interactive=False,
|
235 |
column_widths=["20%"]
|
236 |
)
|
237 |
with gr.Tab("Results: Val"):
|
|
|
246 |
inputs=[],
|
247 |
outputs=[
|
248 |
leaderboard_table_val,
|
249 |
+
leaderboard_table_all,
|
250 |
],
|
251 |
)
|
252 |
with gr.Accordion("Submit a new model for evaluation"):
|
content.py
CHANGED
@@ -15,10 +15,10 @@ ConTextual comprises **506 examples covering 8 real-world visual scenarios** - *
|
|
15 |
### Data Access
|
16 |
ConTextual data can be found on HuggingFace and GitHub.
|
17 |
- HuggingFace
|
18 |
-
- [Test](https://huggingface.co/datasets/ucla-contextual/
|
19 |
- [Val](https://huggingface.co/datasets/ucla-contextual/contextual_val)
|
20 |
- Github
|
21 |
-
- [Test](https://github.com/rohan598/ConTextual/blob/main/data/
|
22 |
- [Val](https://github.com/rohan598/ConTextual/blob/main/data/contextual_val.csv)
|
23 |
|
24 |
### Data Format
|
|
|
15 |
### Data Access
|
16 |
ConTextual data can be found on HuggingFace and GitHub.
|
17 |
- HuggingFace
|
18 |
+
- [Test](https://huggingface.co/datasets/ucla-contextual/contextual_all)
|
19 |
- [Val](https://huggingface.co/datasets/ucla-contextual/contextual_val)
|
20 |
- Github
|
21 |
+
- [Test](https://github.com/rohan598/ConTextual/blob/main/data/contextual_all.csv)
|
22 |
- [Val](https://github.com/rohan598/ConTextual/blob/main/data/contextual_val.csv)
|
23 |
|
24 |
### Data Format
|