Spaces:
Sleeping
Sleeping
Update formatter_node.py
Browse files- formatter_node.py +0 -2
formatter_node.py
CHANGED
|
@@ -2,9 +2,7 @@ import re
|
|
| 2 |
|
| 3 |
def formatter_node(llm_output):
|
| 4 |
cleaned = llm_output.strip()
|
| 5 |
-
# Remove common prefixes like "Answer:", "Final Answer:"
|
| 6 |
cleaned = re.sub(r'^(Answer:|Final Answer:)\s*', '', cleaned, flags=re.IGNORECASE)
|
| 7 |
-
# Remove enclosing quotes if present
|
| 8 |
if cleaned.startswith('"') and cleaned.endswith('"'):
|
| 9 |
cleaned = cleaned[1:-1]
|
| 10 |
return cleaned.strip()
|
|
|
|
| 2 |
|
| 3 |
def formatter_node(llm_output):
|
| 4 |
cleaned = llm_output.strip()
|
|
|
|
| 5 |
cleaned = re.sub(r'^(Answer:|Final Answer:)\s*', '', cleaned, flags=re.IGNORECASE)
|
|
|
|
| 6 |
if cleaned.startswith('"') and cleaned.endswith('"'):
|
| 7 |
cleaned = cleaned[1:-1]
|
| 8 |
return cleaned.strip()
|