Shreyas094 commited on
Commit
d681ee9
·
verified ·
1 Parent(s): fd59db1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -493,9 +493,9 @@ def ask_question(question, temperature, top_p, repetition_penalty, web_search, c
493
 
494
  def extract_answer(full_response, instructions=None):
495
  try:
496
- # Remove the context information
497
- context_pattern = r"Context:.*?Entities:.*?}\s*"
498
- full_response = re.sub(context_pattern, "", full_response, flags=re.DOTALL)
499
 
500
  # List of patterns to remove
501
  patterns_to_remove = [
 
493
 
494
  def extract_answer(full_response, instructions=None):
495
  try:
496
+ # Remove the context information more specifically
497
+ context_pattern = r"Context:.*?Question:.*?Entities:.*?}\s*"
498
+ full_response = re.sub(context_pattern, "", full_response, flags=re.DOTALL | re.IGNORECASE)
499
 
500
  # List of patterns to remove
501
  patterns_to_remove = [