mgyigit commited on
Commit
8a690f5
1 Parent(s): 9bf5a0d

Update src/saving_utils.py

Browse files
Files changed (1) hide show
  1. src/saving_utils.py +4 -2
src/saving_utils.py CHANGED
@@ -12,12 +12,14 @@ def save_similarity_output(output_dict, method_name, leaderboard_path="./data/le
12
  if os.path.exists(leaderboard_path):
13
  leaderboard_df = pd.read_csv(leaderboard_path)
14
  else:
15
- leaderboard_df = pd.DataFrame(columns=['Method'])
 
16
 
17
  if os.path.exists(similarity_path):
18
  similarity_df = pd.read_csv(similarity_path)
19
  else:
20
- similarity_df = pd.DataFrame(columns=['Method'])
 
21
 
22
  # Check if method exists in similarity results
23
  if method_name not in similarity_df['Method'].values:
 
12
  if os.path.exists(leaderboard_path):
13
  leaderboard_df = pd.read_csv(leaderboard_path)
14
  else:
15
+ print("Leaderboard df has not found!")
16
+ return -1
17
 
18
  if os.path.exists(similarity_path):
19
  similarity_df = pd.read_csv(similarity_path)
20
  else:
21
+ print("Similarity df has not found!")
22
+ return -1
23
 
24
  # Check if method exists in similarity results
25
  if method_name not in similarity_df['Method'].values: