Spaces:
Running
Running
Shiyu Zhao
commited on
Commit
·
9698e43
1
Parent(s):
1db5c80
Update space
Browse files
app.py
CHANGED
@@ -75,13 +75,13 @@ def process_single_instance(args):
|
|
75 |
print(f"Warning: pred_rank is not a list for query_id {query_id}")
|
76 |
return None
|
77 |
|
78 |
-
valid_ranks = [rank for rank in pred_rank if isinstance(rank, (int, np.integer)) and 0 <= rank < max_candidate_id]
|
79 |
-
if len(valid_ranks) == 0:
|
80 |
-
|
81 |
-
|
82 |
|
83 |
# Use only valid predictions
|
84 |
-
pred_dict = {
|
85 |
answer_ids = torch.LongTensor(answer_ids)
|
86 |
result = evaluator.evaluate(pred_dict, answer_ids, metrics=eval_metrics)
|
87 |
|
@@ -997,12 +997,12 @@ with gr.Blocks(css=css) as demo:
|
|
997 |
dataset = gr.Dropdown(
|
998 |
choices=["amazon", "mag", "prime"],
|
999 |
label="Dataset*",
|
1000 |
-
value="
|
1001 |
)
|
1002 |
split = gr.Dropdown(
|
1003 |
choices=["test", "test-0.1", "human_generated_eval"],
|
1004 |
label="Split*",
|
1005 |
-
value="
|
1006 |
)
|
1007 |
team_name = gr.Textbox(
|
1008 |
label="Team Name (max 25 chars)*",
|
|
|
75 |
print(f"Warning: pred_rank is not a list for query_id {query_id}")
|
76 |
return None
|
77 |
|
78 |
+
# valid_ranks = [rank for rank in pred_rank if isinstance(rank, (int, np.integer)) and 0 <= rank < max_candidate_id]
|
79 |
+
# if len(valid_ranks) == 0:
|
80 |
+
# print(f"Warning: No valid predictions for query_id {query_id}")
|
81 |
+
# return None
|
82 |
|
83 |
# Use only valid predictions
|
84 |
+
pred_dict = {pred_rank[i]: -i for i in range(min(100, len(pred_rank)))}
|
85 |
answer_ids = torch.LongTensor(answer_ids)
|
86 |
result = evaluator.evaluate(pred_dict, answer_ids, metrics=eval_metrics)
|
87 |
|
|
|
997 |
dataset = gr.Dropdown(
|
998 |
choices=["amazon", "mag", "prime"],
|
999 |
label="Dataset*",
|
1000 |
+
value="prime"
|
1001 |
)
|
1002 |
split = gr.Dropdown(
|
1003 |
choices=["test", "test-0.1", "human_generated_eval"],
|
1004 |
label="Split*",
|
1005 |
+
value="human_generated_eval"
|
1006 |
)
|
1007 |
team_name = gr.Textbox(
|
1008 |
label="Team Name (max 25 chars)*",
|
submissions/a_t_attt/latest.json
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"latest_submission": "20241115_003152",
|
3 |
-
"status": "approved",
|
4 |
-
"method_name": "a-t",
|
5 |
-
"team_name": "attt"
|
6 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
submissions/a_t_attt/metadata_20241115_003152.json
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"Method Name": "a-t",
|
3 |
-
"Team Name": "attt",
|
4 |
-
"Dataset": "prime",
|
5 |
-
"Split": "human_generated_eval",
|
6 |
-
"Contact Email(s)": "a@stanford.edu",
|
7 |
-
"Code Repository": "https://github.com/",
|
8 |
-
"Model Description": "abc",
|
9 |
-
"Hardware": "a100",
|
10 |
-
"(Optional) Paper link": "",
|
11 |
-
"Model Type": "Others",
|
12 |
-
"results": {
|
13 |
-
"hit@1": 0.0,
|
14 |
-
"hit@5": 0.0,
|
15 |
-
"recall@20": 0.0,
|
16 |
-
"mrr": 0.02
|
17 |
-
},
|
18 |
-
"status": "approved",
|
19 |
-
"submission_date": "2024-11-15 00:31:57",
|
20 |
-
"csv_path": "submissions/a_t_attt/predictions_20241115_003152.csv"
|
21 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
submissions/a_t_attt/predictions_20241115_003152.csv
DELETED
The diff for this file is too large to render.
See raw diff
|
|