Thamaraikannan commited on
Commit
cfbbe3f
·
verified ·
1 Parent(s): d8db9fd

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +5 -2
src/streamlit_app.py CHANGED
@@ -8,6 +8,8 @@ from pinecone_text.sparse import BM25Encoder
8
  import os
9
  import pickle
10
  import nltk
 
 
11
 
12
  nltk.download("punkt", quiet=True)
13
  nltk.download("punkt_tab", quiet=True)
@@ -526,7 +528,7 @@ if search_clicked or (query and len(query.strip()) > 0):
526
 
527
  # Display AI response
528
  # st.markdown(ai_response,unsafe_allow_html=True)
529
- st.markdown(f'<div style="background: #303336; padding: 1rem; border-radius: 8px; margin: 1rem 0; line-height: 1.6;">{ai_response}</div>', unsafe_allow_html=True)
530
 
531
 
532
 
@@ -554,7 +556,8 @@ if search_clicked or (query and len(query.strip()) > 0):
554
 
555
  st.markdown("#### [{i}] DOC : {doc_id} | Page: {page_no} | Title {title}".format(i=i, doc_id=doc_id, page_no=page_no, title=title))
556
 
557
- st.markdown(f'<div style="background: #303336; padding: 1rem; border-radius: 8px; margin: 1rem 0; line-height: 1.6;">{text_content}</div>', unsafe_allow_html=True)
 
558
 
559
 
560
  # Expandable full metadata
 
8
  import os
9
  import pickle
10
  import nltk
11
+ import markdown2
12
+
13
 
14
  nltk.download("punkt", quiet=True)
15
  nltk.download("punkt_tab", quiet=True)
 
528
 
529
  # Display AI response
530
  # st.markdown(ai_response,unsafe_allow_html=True)
531
+ st.markdown(ai_response, unsafe_allow_html=True)
532
 
533
 
534
 
 
556
 
557
  st.markdown("#### [{i}] DOC : {doc_id} | Page: {page_no} | Title {title}".format(i=i, doc_id=doc_id, page_no=page_no, title=title))
558
 
559
+ html_content = markdown2.markdown(text_content)
560
+ st.markdown(f'<div style="background: #303336; padding: 1rem; border-radius: 8px; margin: 1rem 0; line-height: 1.6; color: white;">{html_content}</div>', unsafe_allow_html=True)
561
 
562
 
563
  # Expandable full metadata