catastropiyush commited on
Commit
cf7ce84
·
verified ·
1 Parent(s): a44e38e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -1
app.py CHANGED
@@ -76,6 +76,22 @@ st.title("RAG Extractor")
76
  if 'messages' not in st.session_state:
77
  st.session_state.messages = [{'role': 'assistant', "content": 'Hello I am Pingu! Upload a PDF and ask me anything about its content.'}]
78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  with st.sidebar:
80
  st.title("Input")
81
  uploaded_file = st.file_uploader("Upload your PDF Files and then click on the Submit & Process Button")
@@ -84,7 +100,7 @@ with st.sidebar:
84
  filepath = "data/saved_pdf.pdf"
85
  with open(filepath, "wb") as f:
86
  f.write(uploaded_file.getbuffer())
87
- displayPDF(filepath)
88
  data_ingestion() # Process PDF every time new file is uploaded
89
  st.success("PDF is ready!")
90
 
 
76
  if 'messages' not in st.session_state:
77
  st.session_state.messages = [{'role': 'assistant', "content": 'Hello I am Pingu! Upload a PDF and ask me anything about its content.'}]
78
 
79
+ # Define your custom icon
80
+ custom_icon_url = "./custom_icon.png" # Adjust this to your icon's file path
81
+
82
+ # CSS to customize the chatbot icon
83
+ st.markdown(f"""
84
+ <style>
85
+ .chat-container .stChatMessage.st-chat-bot {
86
+ background-image: url({custom_icon_url});
87
+ background-size: contain;
88
+ background-repeat: no-repeat;
89
+ background-position: left center;
90
+ padding-left: 60px; /* Adjust this value according to the icon size */
91
+ }
92
+ </style>
93
+ """, unsafe_allow_html=True)
94
+
95
  with st.sidebar:
96
  st.title("Input")
97
  uploaded_file = st.file_uploader("Upload your PDF Files and then click on the Submit & Process Button")
 
100
  filepath = "data/saved_pdf.pdf"
101
  with open(filepath, "wb") as f:
102
  f.write(uploaded_file.getbuffer())
103
+ displayPDF(filepath)
104
  data_ingestion() # Process PDF every time new file is uploaded
105
  st.success("PDF is ready!")
106