MJobe commited on
Commit
41ddd5c
·
1 Parent(s): 41d335c

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -6
main.py CHANGED
@@ -40,10 +40,10 @@ async def perform_document_qa(
40
  question.strip()
41
  )
42
 
43
- # Print the result for debugging
44
- print(result)
45
 
46
- answers_dict[question] = result['answer']
47
 
48
  return answers_dict
49
  except Exception as e:
@@ -69,10 +69,10 @@ async def load_file(
69
  question.strip()
70
  )
71
 
72
- # Print the result for debugging
73
- print(result)
74
 
75
- answers_dict[question] = result['answer']
76
 
77
  return answers_dict
78
  except Exception as e:
 
40
  question.strip()
41
  )
42
 
43
+ # Access the 'answer' key from the first item in the result list
44
+ answer = result[0]['answer']
45
 
46
+ answers_dict[question] = answer
47
 
48
  return answers_dict
49
  except Exception as e:
 
69
  question.strip()
70
  )
71
 
72
+ # Access the 'answer' key from the first item in the result list
73
+ answer = result[0]['answer']
74
 
75
+ answers_dict[question] = answer
76
 
77
  return answers_dict
78
  except Exception as e: