Spaces:
Running
Running
abhinav-joshi
commited on
Commit
•
684cda7
1
Parent(s):
5f67e27
fix token
Browse files- app.py +1 -60
- uploads.py +1 -1
app.py
CHANGED
@@ -27,66 +27,13 @@ def restart_space():
|
|
27 |
|
28 |
# Function to load data from a given CSV file
|
29 |
def baseline_load_data(tasks, task_metrics):
|
30 |
-
# # version = version.replace("%", "p")
|
31 |
-
# file_path = f"submissions/baseline/baseline.csv" # Replace with your file paths
|
32 |
-
# df = pd.read_csv(file_path)
|
33 |
-
|
34 |
-
# we only want specific columns and in a specific order
|
35 |
-
|
36 |
-
# column_names = [
|
37 |
-
# "Method",
|
38 |
-
# "Submitted By",
|
39 |
-
# "L-NER",
|
40 |
-
# "RR",
|
41 |
-
# "CJPE",
|
42 |
-
# "BAIL",
|
43 |
-
# "LSI",
|
44 |
-
# "PCR",
|
45 |
-
# "SUMM",
|
46 |
-
# "Average",
|
47 |
-
# ]
|
48 |
-
# # Method,Submitted by,L-NER,RR,CJPE,BAIL,LSI,PCR,SUMM,L-MT
|
49 |
-
# column_names = [
|
50 |
-
# "Method",
|
51 |
-
# "Submitted By",
|
52 |
-
# "L-NER",
|
53 |
-
# "RR",
|
54 |
-
# "CJPE",
|
55 |
-
# "BAIL",
|
56 |
-
# "LSI",
|
57 |
-
# "PCR",
|
58 |
-
# "SUMM",
|
59 |
-
# # "Average",
|
60 |
-
# ]
|
61 |
-
|
62 |
-
# if tasks is None:
|
63 |
-
# breakpoint()
|
64 |
-
# # based on the tasks, remove the columns that are not needed
|
65 |
-
# if "L-NER" not in tasks:
|
66 |
-
# column_names.remove("L-NER")
|
67 |
-
# if "RR" not in tasks:
|
68 |
-
# column_names.remove("RR")
|
69 |
-
# if "CJPE" not in tasks:
|
70 |
-
# column_names.remove("CJPE")
|
71 |
-
# if "BAIL" not in tasks:
|
72 |
-
# column_names.remove("BAIL")
|
73 |
-
# if "LSI" not in tasks:
|
74 |
-
# column_names.remove("LSI")
|
75 |
-
# if "PCR" not in tasks:
|
76 |
-
# column_names.remove("PCR")
|
77 |
-
# if "SUMM" not in tasks:
|
78 |
-
# column_names.remove("SUMM")
|
79 |
-
|
80 |
-
# df = df[column_names]
|
81 |
|
82 |
import json
|
83 |
|
84 |
# load the results json file
|
85 |
with open("submissions/baseline/results.json") as f:
|
86 |
results = json.load(f)
|
87 |
-
|
88 |
-
# Method,Submitted By,L-NER,RR,CJPE,BAIL,LSI,PCR,SUMM,L-MT
|
89 |
-
# Metric,-,strict mF1,mF1,mF1|ROUGE-L|BLEU,mF1,mF1,muF1@K,ROUGE-L|BERTSCORE,BLEU|GLEU|chrF++
|
90 |
# create a new df to display the results
|
91 |
results_df = pd.DataFrame(
|
92 |
columns=[
|
@@ -124,12 +71,7 @@ def baseline_load_data(tasks, task_metrics):
|
|
124 |
ignore_index=True,
|
125 |
)
|
126 |
|
127 |
-
# breakpoint()
|
128 |
-
# add the average column
|
129 |
-
# results_df["Average"] = results_df.mean(axis=1)
|
130 |
-
|
131 |
df = results_df
|
132 |
-
# df = df.sort_values(by="Average", ascending=False)
|
133 |
# remove the columns that are not in tasks
|
134 |
selected_columns = (
|
135 |
[
|
@@ -139,7 +81,6 @@ def baseline_load_data(tasks, task_metrics):
|
|
139 |
+ tasks
|
140 |
+ ["Github Link"]
|
141 |
)
|
142 |
-
# print(tasks)
|
143 |
df = df[selected_columns]
|
144 |
|
145 |
df = df.drop_duplicates(subset=["Method"], keep="first")
|
|
|
27 |
|
28 |
# Function to load data from a given CSV file
|
29 |
def baseline_load_data(tasks, task_metrics):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
import json
|
32 |
|
33 |
# load the results json file
|
34 |
with open("submissions/baseline/results.json") as f:
|
35 |
results = json.load(f)
|
36 |
+
|
|
|
|
|
37 |
# create a new df to display the results
|
38 |
results_df = pd.DataFrame(
|
39 |
columns=[
|
|
|
71 |
ignore_index=True,
|
72 |
)
|
73 |
|
|
|
|
|
|
|
|
|
74 |
df = results_df
|
|
|
75 |
# remove the columns that are not in tasks
|
76 |
selected_columns = (
|
77 |
[
|
|
|
81 |
+ tasks
|
82 |
+ ["Github Link"]
|
83 |
)
|
|
|
84 |
df = df[selected_columns]
|
85 |
|
86 |
df = df.drop_duplicates(subset=["Method"], keep="first")
|
uploads.py
CHANGED
@@ -125,7 +125,7 @@ def add_new_eval(
|
|
125 |
api.upload_file(
|
126 |
repo_id=LEADERBOARD_PATH,
|
127 |
# path_in_repo=f"submissions/baseline/baseline.csv",
|
128 |
-
path_in_repo=f"submissions/results.json",
|
129 |
path_or_fileobj=leaderboard_buffer,
|
130 |
token=TOKEN,
|
131 |
repo_type="space",
|
|
|
125 |
api.upload_file(
|
126 |
repo_id=LEADERBOARD_PATH,
|
127 |
# path_in_repo=f"submissions/baseline/baseline.csv",
|
128 |
+
path_in_repo=f"submissions/baseline/results.json",
|
129 |
path_or_fileobj=leaderboard_buffer,
|
130 |
token=TOKEN,
|
131 |
repo_type="space",
|