LakshmiHarika commited on
Commit
b753910
·
verified ·
1 Parent(s): bab01e5

Update pages/Data Collection.py

Browse files
Files changed (1) hide show
  1. pages/Data Collection.py +14 -5
pages/Data Collection.py CHANGED
@@ -883,11 +883,20 @@ elif st.session_state.current_page == "opencv_operations":
883
 
884
  if st.button("Open Jupyter Notebook"):
885
  try:
886
- with open("images_page_2.html", "r", encoding="utf-8") as f:
887
- notebook_html = f.read()
888
- st.components.v1.html(notebook_html, height=800, scrolling=True)
889
- except FileNotFoundError:
890
- st.error("Notebook HTML file not found.")
 
 
 
 
 
 
 
 
 
891
 
892
 
893
  st.write("""
 
883
 
884
  if st.button("Open Jupyter Notebook"):
885
  try:
886
+ # Fetch the HTML file from the Hugging Face link
887
+ url = "https://huggingface.co/spaces/LakshmiHarika/MachineLearning/resolve/main/Jupyter_Notes/images_page_2.html"
888
+ response = requests.get(url)
889
+
890
+ # Check if the response is successful
891
+ if response.status_code == 200:
892
+ notebook_html = response.text
893
+ # Render the HTML content in Streamlit
894
+ st.components.v1.html(notebook_html, height=1000, scrolling=True)
895
+ else:
896
+ st.error(f"Failed to load the notebook. HTTP Status: {response.status_code}")
897
+
898
+ except Exception as e:
899
+ st.error(f"An error occurred: {e}")
900
 
901
 
902
  st.write("""