namberino commited on
Commit
8f59797
·
1 Parent(s): 028a091

Update return

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -291,7 +291,7 @@ async def generate_endpoint(
291
  try:
292
  # rag.build_index_from_pdf(tmp_path)
293
  # validate_mcqs expects keys as strings and the normalized content
294
- validation_report = rag.validate_mcqs(mcqs, top_k=top_k)
295
  except Exception as e:
296
  # don't fail the whole request for a validation error — return generator output and note the error
297
  validation_report = {"error": f"Validation failed: {e}"}
@@ -299,7 +299,7 @@ async def generate_endpoint(
299
 
300
  # log_pipeline('test/mcq_output.json', content={"mcqs": mcqs, "validation": validation_report})
301
 
302
- return {"mcqs": mcqs, "validation": validation_report}
303
 
304
 
305
  if __name__ == "__main__":
 
291
  try:
292
  # rag.build_index_from_pdf(tmp_path)
293
  # validate_mcqs expects keys as strings and the normalized content
294
+ validation_report = rag.validate_mcqs(all_mcqs, top_k=top_k)
295
  except Exception as e:
296
  # don't fail the whole request for a validation error — return generator output and note the error
297
  validation_report = {"error": f"Validation failed: {e}"}
 
299
 
300
  # log_pipeline('test/mcq_output.json', content={"mcqs": mcqs, "validation": validation_report})
301
 
302
+ return {"mcqs": all_mcqs, "validation": validation_report}
303
 
304
 
305
  if __name__ == "__main__":