Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2107,20 +2107,7 @@ def clean_and_format_markdown(text: str) -> str:
|
|
| 2107 |
return text
|
| 2108 |
|
| 2109 |
|
| 2110 |
-
def minimal_clean_text(text):
|
| 2111 |
-
# Normalize Unicode to ensure a consistent form
|
| 2112 |
-
text = unicodedata.normalize('NFKC', text)
|
| 2113 |
-
|
| 2114 |
-
# Remove zero-width and invisible characters
|
| 2115 |
-
# (e.g., \u200B, \uFEFF, \u200C, \u200D)
|
| 2116 |
-
text = re.sub(r'[\u200B\uFEFF\u200C\u200D]', '', text)
|
| 2117 |
|
| 2118 |
-
# Remove control characters (ASCII control chars and DEL)
|
| 2119 |
-
text = re.sub(r'[\x00-\x1F\x7F-\x9F]', '', text)
|
| 2120 |
-
|
| 2121 |
-
# Do not alter spacing, punctuation, or other formatting
|
| 2122 |
-
|
| 2123 |
-
return text
|
| 2124 |
|
| 2125 |
prompt = st.chat_input("")
|
| 2126 |
global combined_text
|
|
@@ -2292,7 +2279,6 @@ def handle_prompt(prompt):
|
|
| 2292 |
with response_placeholder:
|
| 2293 |
with st.chat_message("assistant"):
|
| 2294 |
st.markdown(full_response, unsafe_allow_html=True)
|
| 2295 |
-
st.write(full_response)
|
| 2296 |
|
| 2297 |
#st.write(combined_text,unsafe_allow_html=True)
|
| 2298 |
st.session_state.chat_history.append({"role": "assistant", "content": combined_text})
|
|
|
|
| 2107 |
return text
|
| 2108 |
|
| 2109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2111 |
|
| 2112 |
prompt = st.chat_input("")
|
| 2113 |
global combined_text
|
|
|
|
| 2279 |
with response_placeholder:
|
| 2280 |
with st.chat_message("assistant"):
|
| 2281 |
st.markdown(full_response, unsafe_allow_html=True)
|
|
|
|
| 2282 |
|
| 2283 |
#st.write(combined_text,unsafe_allow_html=True)
|
| 2284 |
st.session_state.chat_history.append({"role": "assistant", "content": combined_text})
|