Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 = [
|