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

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +8 -2
main.py CHANGED
@@ -43,7 +43,10 @@ async def perform_document_qa(
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:
@@ -72,7 +75,10 @@ async def load_file(
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:
 
43
  # Access the 'answer' key from the first item in the result list
44
  answer = result[0]['answer']
45
 
46
+ # Format the question as a string without extra characters
47
+ formatted_question = question.strip("[]")
48
+
49
+ answers_dict[formatted_question] = answer
50
 
51
  return answers_dict
52
  except Exception as e:
 
75
  # Access the 'answer' key from the first item in the result list
76
  answer = result[0]['answer']
77
 
78
+ # Format the question as a string without extra characters
79
+ formatted_question = question.strip("[]")
80
+
81
+ answers_dict[formatted_question] = answer
82
 
83
  return answers_dict
84
  except Exception as e: