themanas021 commited on
Commit
0b87ce8
·
1 Parent(s): 5b2a298

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -102,16 +102,16 @@ def get_file_size(file):
102
 
103
  @st.cache_data
104
  #function to display the PDF of a given file
105
- def displayPDF(file):
106
- # Opening file from file path
107
- with open(file, "rb") as f:
108
- base64_pdf = base64.b64encode(f.read()).decode('utf-8')
109
 
110
- # Embedding PDF in HTML
111
- pdf_display = F'<iframe src="data:application/pdf;base64,{base64_pdf}" width="100%" height="600" type="application/pdf"></iframe>'
112
 
113
- # Displaying File
114
- st.markdown(pdf_display, unsafe_allow_html=True)
115
 
116
  # Display conversation history using Streamlit messages
117
  def display_conversation(history):
@@ -140,8 +140,8 @@ def main():
140
  with col1:
141
  st.markdown("<h4 style color:black;'>File details</h4>", unsafe_allow_html=True)
142
  st.json(file_details)
143
- st.markdown("<h4 style color:black;'>File preview</h4>", unsafe_allow_html=True)
144
- pdf_view = displayPDF(filepath)
145
 
146
  with col2:
147
  with st.spinner('Embeddings are in process...'):
 
102
 
103
  @st.cache_data
104
  #function to display the PDF of a given file
105
+ # def displayPDF(file):
106
+ # # Opening file from file path
107
+ # with open(file, "rb") as f:
108
+ # base64_pdf = base64.b64encode(f.read()).decode('utf-8')
109
 
110
+ # # Embedding PDF in HTML
111
+ # pdf_display = F'<iframe src="data:application/pdf;base64,{base64_pdf}" width="100%" height="600" type="application/pdf"></iframe>'
112
 
113
+ # # Displaying File
114
+ # st.markdown(pdf_display, unsafe_allow_html=True)
115
 
116
  # Display conversation history using Streamlit messages
117
  def display_conversation(history):
 
140
  with col1:
141
  st.markdown("<h4 style color:black;'>File details</h4>", unsafe_allow_html=True)
142
  st.json(file_details)
143
+ # st.markdown("<h4 style color:black;'>File preview</h4>", unsafe_allow_html=True)
144
+ # pdf_view = displayPDF(filepath)
145
 
146
  with col2:
147
  with st.spinner('Embeddings are in process...'):