Update app.py
Browse files
app.py
CHANGED
@@ -451,12 +451,12 @@ if prompt:
|
|
451 |
# Final display without cursor
|
452 |
if full_response:
|
453 |
# Clean up any excessive dash lines or formatting issues
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
else:
|
461 |
message_placeholder.markdown("No response received from the model.")
|
462 |
|
@@ -544,7 +544,7 @@ scroll_script = """
|
|
544 |
window.addEventListener('load', scrollToBottom);
|
545 |
document.addEventListener('DOMContentLoaded', scrollToBottom);
|
546 |
|
547 |
-
// Additional periodic check for slow connections
|
548 |
setInterval(scrollToBottom, 1000);
|
549 |
</script>
|
550 |
"""
|
|
|
451 |
# Final display without cursor
|
452 |
if full_response:
|
453 |
# Clean up any excessive dash lines or formatting issues
|
454 |
+
cleaned_response = full_response
|
455 |
+
# Replace multiple consecutive dash lines with a single line
|
456 |
+
cleaned_response = re.sub(r'β{5,}', 'βββββ', cleaned_response)
|
457 |
+
# Remove excessive newlines
|
458 |
+
cleaned_response = re.sub(r'\n{3,}', '\n\n', cleaned_response)
|
459 |
+
message_placeholder.markdown(cleaned_response)
|
460 |
else:
|
461 |
message_placeholder.markdown("No response received from the model.")
|
462 |
|
|
|
544 |
window.addEventListener('load', scrollToBottom);
|
545 |
document.addEventListener('DOMContentLoaded', scrollToBottom);
|
546 |
|
547 |
+
// Additional periodic check for slow connections S
|
548 |
setInterval(scrollToBottom, 1000);
|
549 |
</script>
|
550 |
"""
|