Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -529,8 +529,9 @@ if prompt :
|
|
| 529 |
})
|
| 530 |
full_response = output["output"]
|
| 531 |
|
| 532 |
-
|
| 533 |
-
cleaned_text =
|
|
|
|
| 534 |
# Display the response
|
| 535 |
if "**Trust Tip**" not in full_response and "**Suggestion**" not in full_response:
|
| 536 |
trust_tip = random.choice(trust_tips)
|
|
|
|
| 529 |
})
|
| 530 |
full_response = output["output"]
|
| 531 |
|
| 532 |
+
cleaned_text = re.sub(r'\s+', ' ', full_response) # Replace multiple spaces or newlines with a single space
|
| 533 |
+
cleaned_text = re.sub(r'([a-z])(\d)', r'\1 \2', full_response) # Add a space between letters and numbers if necessary
|
| 534 |
+
|
| 535 |
# Display the response
|
| 536 |
if "**Trust Tip**" not in full_response and "**Suggestion**" not in full_response:
|
| 537 |
trust_tip = random.choice(trust_tips)
|