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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -493,6 +493,10 @@ def ask_question(question, temperature, top_p, repetition_penalty, web_search, c
493
 
494
  def extract_answer(full_response, instructions=None):
495
  try:
 
 
 
 
496
  # List of patterns to remove
497
  patterns_to_remove = [
498
  r"Provide a concise and relevant answer to the question\.",
 
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 = [
502
  r"Provide a concise and relevant answer to the question\.",