Skip to content

Commit 2068f64

Browse files
committed
fix output path, handle nan in very wrong answer, raise error
1 parent 5218f3d commit 2068f64

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

agent/notebooks/convert_halted_questions.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def determine_correctness(options, correct_index, very_wrong_answer):
109109
def main():
110110
# Define input and output paths
111111
input_csv_path = 'halted_questions.csv'
112-
output_dir = './'
112+
output_dir = './ai_eval_sheets'
113113
output_questions_path = output_dir + 'questions.csv'
114114
output_options_path = output_dir + 'question_options.csv'
115115

@@ -267,7 +267,8 @@ def main():
267267
new_option_letter_map = {i: chr(65 + i) for i in range(len(selected_options))}
268268

269269
# Get the very wrong answer for this question, if available
270-
very_wrong_answer = row.get('Very Wrong Answer', '').strip() if 'Very Wrong Answer' in row else ''
270+
raw_vwa_val = row.get('Very Wrong Answer')
271+
very_wrong_answer = str(raw_vwa_val).strip() if pd.notna(raw_vwa_val) else ''
271272

272273
# Create a map of options and their correctness values
273274
option_texts = [opt_detail['text'] for opt_detail in selected_options]
@@ -319,7 +320,8 @@ def main():
319320
except FileNotFoundError:
320321
print(f"Error: Input file not found at {input_csv_path}")
321322
except Exception as e:
322-
print(f"An error occurred: {e}")
323+
raise
324+
# print(f"An error occurred: {e}")
323325

324326
if __name__ == '__main__':
325327
main()

0 commit comments

Comments
 (0)