Spaces:
Runtime error
Runtime error
Update app/main.py
Browse files- app/main.py +1 -1
app/main.py
CHANGED
@@ -1194,7 +1194,7 @@ def generate_response(prompt: Prompt):
|
|
1194 |
|
1195 |
response_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
1196 |
clean_response = response_text.strip().strip('"').strip()
|
1197 |
-
pattern = r"Dear\s
|
1198 |
matching = re.search(pattern, clean_response, re.DOTALL)
|
1199 |
if matching:
|
1200 |
message = matching.group(0)
|
|
|
1194 |
|
1195 |
response_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
1196 |
clean_response = response_text.strip().strip('"').strip()
|
1197 |
+
pattern = r"(Dear\s+[^\n]+,\s*\n(?:.*?\n)*?)Best regards,\s*\[Your Name\]"
|
1198 |
matching = re.search(pattern, clean_response, re.DOTALL)
|
1199 |
if matching:
|
1200 |
message = matching.group(0)
|