codys12 commited on
Commit
428f41a
·
1 Parent(s): 71ee6de

Upload handler.py

Browse files
Files changed (1) hide show
  1. handler.py +1 -1
handler.py CHANGED
@@ -155,7 +155,7 @@ def parse(generated_text: str, conclusions: list[tuple[str, str]], end_sequences
155
  for conclusion_key, _ in conclusions:
156
  if conclusion_key in generated_text:
157
  conclusion_found = conclusion_key
158
- break
159
 
160
  # Extract context numbers from the generated text
161
  context_pattern = r"\[\d+\]"
 
155
  for conclusion_key, _ in conclusions:
156
  if conclusion_key in generated_text:
157
  conclusion_found = conclusion_key
158
+ generated_text = generated_text.replace(conclusion_key, "")
159
 
160
  # Extract context numbers from the generated text
161
  context_pattern = r"\[\d+\]"