ignaciaginting commited on
Commit
e22af09
·
verified ·
1 Parent(s): d75400e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -37,8 +37,8 @@ if pdf_file and question:
37
  # Run the pipeline
38
  with st.spinner("Searching for the answer..."):
39
  result = qa_pipeline(img, question)
40
- if results:
41
- top_answer = results[0] # get the highest-scoring answer
42
  st.success(f"**Answer:** {top_answer['answer']} (score: {top_answer['score']:.2f})")
43
  else:
44
  st.warning("No answer found.")
 
37
  # Run the pipeline
38
  with st.spinner("Searching for the answer..."):
39
  result = qa_pipeline(img, question)
40
+ if result:
41
+ top_answer = result[0] # get the highest-scoring answer
42
  st.success(f"**Answer:** {top_answer['answer']} (score: {top_answer['score']:.2f})")
43
  else:
44
  st.warning("No answer found.")