kpal002 commited on
Commit
729f5f4
·
verified ·
1 Parent(s): 8b63b09

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -245,12 +245,12 @@ def process_pdf(uploaded_files, llm_model, n_criteria = num_criteria):
245
 
246
  # Evaluate with OpenAI model
247
  total_score, criteria_met, score_percentage, score_list, reasoning = pdf_criteria_query.evaluate_with_llm(registration_result, peer_journal_result, eq_journal_result, queries)
248
- logger.info("Total score: %s", total_score)
249
 
250
  try:
251
  # Define the path to your CSV file
252
  csv_file_path = 'storing_output.csv'
253
- print(csv_file_path)
254
 
255
  # Create a dictionary for the new row
256
  new_row = {
@@ -263,16 +263,16 @@ def process_pdf(uploaded_files, llm_model, n_criteria = num_criteria):
263
 
264
  # Convert new_row dictionary to a DataFrame for easy appending
265
  new_row_df = pd.DataFrame([new_row])
266
- logger.debug("New row DataFrame:\n%s", new_row_df)
267
 
268
  # Check if the CSV file exists
269
  if os.path.exists(csv_file_path):
270
  # Load the existing data
271
- logger.debug("CSV file exists. Loading existing data.")
272
  df = pd.read_csv(csv_file_path)
273
  else:
274
  # Or create a new DataFrame if the file does not exist
275
- logger.debug("CSV file does not exist. Creating a new DataFrame.")
276
  columns = ['Id', 'Title', 'Author'] + [f'score_cr_{i}' for i in range(1, 10)] + [f'reasoning_cr_{i}' for i in range(1, 10)]
277
  df = pd.DataFrame(columns=columns)
278
 
 
245
 
246
  # Evaluate with OpenAI model
247
  total_score, criteria_met, score_percentage, score_list, reasoning = pdf_criteria_query.evaluate_with_llm(registration_result, peer_journal_result, eq_journal_result, queries)
248
+
249
 
250
  try:
251
  # Define the path to your CSV file
252
  csv_file_path = 'storing_output.csv'
253
+ logger.info("CSV file path: %s", csv_file_path)
254
 
255
  # Create a dictionary for the new row
256
  new_row = {
 
263
 
264
  # Convert new_row dictionary to a DataFrame for easy appending
265
  new_row_df = pd.DataFrame([new_row])
266
+ logger.info("New row DataFrame:\n%s", new_row_df)
267
 
268
  # Check if the CSV file exists
269
  if os.path.exists(csv_file_path):
270
  # Load the existing data
271
+ logger.info("CSV file exists. Loading existing data.")
272
  df = pd.read_csv(csv_file_path)
273
  else:
274
  # Or create a new DataFrame if the file does not exist
275
+ logger.info("CSV file does not exist. Creating a new DataFrame.")
276
  columns = ['Id', 'Title', 'Author'] + [f'score_cr_{i}' for i in range(1, 10)] + [f'reasoning_cr_{i}' for i in range(1, 10)]
277
  df = pd.DataFrame(columns=columns)
278