Umer797 commited on
Commit
71c390e
·
verified ·
1 Parent(s): 11517f4

Update formatter_node.py

Browse files
Files changed (1) hide show
  1. 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()