Spaces:
Sleeping
Sleeping
Update model_comparison.py
Browse files- model_comparison.py +17 -15
model_comparison.py
CHANGED
@@ -77,21 +77,23 @@ def dataframe_with_selections(df):
|
|
77 |
def add_user_evalID_columns_to_df(df, evalDataPath):
|
78 |
# with open(evalDataPath, 'r') as f:
|
79 |
# yamlData = safe_load(f)
|
80 |
-
yamlData = safe_load(
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
df
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
|
|
|
|
95 |
return df
|
96 |
|
97 |
def initialise_page(tab):
|
|
|
77 |
def add_user_evalID_columns_to_df(df, evalDataPath):
|
78 |
# with open(evalDataPath, 'r') as f:
|
79 |
# yamlData = safe_load(f)
|
80 |
+
# yamlData = safe_load()
|
81 |
+
with open(hf_hub_download(repo_id="JVice/try-before-you-bias-data", filename=evalDataPath, repo_type="dataset"), 'r') as f:
|
82 |
+
yamlData = safe_load(f)
|
83 |
+
st.write(yamlData)
|
84 |
+
for user in yamlData['evaluations']['username']:
|
85 |
+
if df is None:
|
86 |
+
df = pd.DataFrame(yamlData['evaluations']['username'][user]).T
|
87 |
+
df.insert(0, "Eval. ID", list(yamlData['evaluations']['username'][user].keys()), True)
|
88 |
+
else:
|
89 |
+
df = pd.concat([df, pd.DataFrame(yamlData['evaluations']['username'][user]).T],
|
90 |
+
ignore_index=True)
|
91 |
+
evalIDIterator = 0
|
92 |
+
for index, row in df.iterrows():
|
93 |
+
if row['Eval. ID'] is np.nan:
|
94 |
+
df.loc[index, 'Eval. ID'] = list(yamlData['evaluations']['username'][user].keys())[
|
95 |
+
evalIDIterator]
|
96 |
+
evalIDIterator += 1
|
97 |
return df
|
98 |
|
99 |
def initialise_page(tab):
|