Wajahat698 commited on
Commit
43d5ece
·
verified ·
1 Parent(s): 4858aec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -2274,6 +2274,11 @@ def handle_prompt(prompt):
2274
  full_response = output["output"]
2275
 
2276
  cleaned_text = minimal_clean_text(full_response)
 
 
 
 
 
2277
 
2278
  # Use Markdown with a styled div to ensure proper word wrapping
2279
 
@@ -2284,11 +2289,11 @@ def handle_prompt(prompt):
2284
  trust_tip, suggestion = get_trust_tip_and_suggestion()
2285
 
2286
  # Combine the response text with Trust Tip and Suggestion
2287
- combined_text = f"{cleaned_text}\n\n---\n\n**Trust Tip**: {trust_tip}\n\n**Suggestion**: {suggestion}"
2288
 
2289
  else:
2290
  # If already present, just use the full response
2291
- combined_text = cleaned_text
2292
  with response_placeholder:
2293
  with st.chat_message("assistant"):
2294
  st.markdown(combined_text, unsafe_allow_html=True)
 
2274
  full_response = output["output"]
2275
 
2276
  cleaned_text = minimal_clean_text(full_response)
2277
+ html_content = f"""
2278
+ <div style="white-space: pre-wrap; word-break: break-word;">
2279
+ {cleaned_text}
2280
+ </div>
2281
+ """
2282
 
2283
  # Use Markdown with a styled div to ensure proper word wrapping
2284
 
 
2289
  trust_tip, suggestion = get_trust_tip_and_suggestion()
2290
 
2291
  # Combine the response text with Trust Tip and Suggestion
2292
+ combined_text = f"{html_content}\n\n---\n\n**Trust Tip**: {trust_tip}\n\n**Suggestion**: {suggestion}"
2293
 
2294
  else:
2295
  # If already present, just use the full response
2296
+ combined_text = html_content
2297
  with response_placeholder:
2298
  with st.chat_message("assistant"):
2299
  st.markdown(combined_text, unsafe_allow_html=True)