Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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\.",
|