Anne31415 commited on
Commit
e752667
·
verified ·
1 Parent(s): 578a148

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -19
app.py CHANGED
@@ -246,31 +246,26 @@ def page1():
246
  """
247
  st.markdown(hide_streamlit_style, unsafe_allow_html=True)
248
 
249
- # Create columns for layout
250
  col1, col2 = st.columns([3, 1]) # Adjust the ratio to your liking
251
 
252
  with col1:
253
  st.title("Alles zur aktuellen Krankenhausreform!")
254
 
255
  with col2:
256
- # Load and display the image in the right column, which will be the top-right corner of the page
257
-
258
-
259
- # Attempt to load the image with enhanced error handling
260
- try:
261
- # Construct the absolute path to the image file
262
- current_dir = os.getcwd() # Get the current working directory
263
- image_path = os.path.join(current_dir, 'BinDoc Logo (Quadratisch).png')
264
-
265
- # Load and display the image
266
- image = Image.open(image_path)
267
- st.image(image, use_column_width='always')
268
- except FileNotFoundError:
269
- st.error(f"File not found. Please check the file path. Attempted path: {image_path}")
270
- except Exception as e:
271
- st.error(f"An unexpected error occurred while loading the image: {e}")
272
-
273
-
274
 
275
  if not os.path.exists(pdf_path):
276
  st.error("File not found. Please check the file path.")
@@ -278,6 +273,7 @@ def page1():
278
 
279
  VectorStore = load_vector_store(pdf_path, "KH_Reform_2301", force_reload=False)
280
 
 
281
  display_chat_history(st.session_state['chat_history_page1'])
282
 
283
  st.write("<!-- Start Spacer -->", unsafe_allow_html=True)
 
246
  """
247
  st.markdown(hide_streamlit_style, unsafe_allow_html=True)
248
 
249
+ # Create columns for layout
250
  col1, col2 = st.columns([3, 1]) # Adjust the ratio to your liking
251
 
252
  with col1:
253
  st.title("Alles zur aktuellen Krankenhausreform!")
254
 
255
  with col2:
256
+ # Attempt to load the image with enhanced error handling
257
+ try:
258
+ # Construct the absolute path to the image file
259
+ current_dir = os.getcwd() # Get the current working directory
260
+ image_path = os.path.join(current_dir, 'BinDoc Logo (Quadratisch).png')
261
+
262
+ # Load and display the image
263
+ image = Image.open(image_path)
264
+ st.image(image, use_column_width='always')
265
+ except FileNotFoundError:
266
+ st.error(f"File not found. Please check the file path. Attempted path: {image_path}")
267
+ except Exception as e:
268
+ st.error(f"An unexpected error occurred while loading the image: {e}")
 
 
 
 
 
269
 
270
  if not os.path.exists(pdf_path):
271
  st.error("File not found. Please check the file path.")
 
273
 
274
  VectorStore = load_vector_store(pdf_path, "KH_Reform_2301", force_reload=False)
275
 
276
+
277
  display_chat_history(st.session_state['chat_history_page1'])
278
 
279
  st.write("<!-- Start Spacer -->", unsafe_allow_html=True)