KGSAGAR commited on
Commit
4cb6754
·
verified ·
1 Parent(s): 5c427d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -52,8 +52,9 @@ def respond(message, history, system_message, max_tokens, temperature, top_p):
52
  Extracts and returns content between <user>...</user> tags in the given text.
53
  If multiple such sections exist, their contents are concatenated.
54
  """
55
- pattern = re.compile('output', re.IGNORECASE)
56
- matches = re.findall(pattern, text, re.DOTALL)
 
57
  extracted_content = '\n'.join(match.strip() for match in matches)
58
  return extracted_content
59
  lines = extract_user_content(generated_text)
 
52
  Extracts and returns content between <user>...</user> tags in the given text.
53
  If multiple such sections exist, their contents are concatenated.
54
  """
55
+ # Compile the pattern with the desired flags
56
+ pattern = re.compile(r'output', re.DOTALL | re.IGNORECASE)
57
+ matches = re.findall(pattern, text)
58
  extracted_content = '\n'.join(match.strip() for match in matches)
59
  return extracted_content
60
  lines = extract_user_content(generated_text)