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