sam2ai commited on
Commit
c9f5d3f
1 Parent(s): 45a3223

Synced repo using 'sync_with_huggingface' Github Action

Browse files
Files changed (3) hide show
  1. pages/1_URLs.py +5 -0
  2. pages/2_Documents.py +21 -10
  3. styles.css +2 -19
pages/1_URLs.py CHANGED
@@ -13,6 +13,11 @@ import requests
13
  from bs4 import BeautifulSoup
14
  import json
15
 
 
 
 
 
 
16
  # ----- FUNCTIONS -----
17
  # function to check whether the url is a sitemap or not
18
  def check_sitemap(url):
 
13
  from bs4 import BeautifulSoup
14
  import json
15
 
16
+ # Load CSS file
17
+ def load_css(file_path):
18
+ with open(file_path) as f:
19
+ st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html=True)
20
+
21
  # ----- FUNCTIONS -----
22
  # function to check whether the url is a sitemap or not
23
  def check_sitemap(url):
pages/2_Documents.py CHANGED
@@ -9,6 +9,11 @@ import docx2txt
9
  import requests
10
  import pdfplumber
11
 
 
 
 
 
 
12
  # function to run the enter button
13
  def run_function(documents):
14
  data = ""
@@ -74,11 +79,12 @@ def main():
74
  st.session_state.extracted_doc = False
75
  data = ""
76
 
77
-
78
- if st.button("Enter"):
79
- st.session_state.button_enter_doc = True
80
-
81
-
 
82
 
83
  # the enter button
84
  if st.session_state.button_enter_doc:
@@ -115,12 +121,17 @@ def main():
115
  st.success(f"File saved successfully.")
116
 
117
  else:
 
118
  st.warning("Data not extracted")
119
- if st.button("clear"):
120
- st.session_state.button_enter_doc = False
121
- st.session_state.extracted_doc = False
122
- st.experimental_rerun()
123
-
 
 
 
 
124
 
125
 
126
 
 
9
  import requests
10
  import pdfplumber
11
 
12
+ # Load CSS file
13
+ def load_css(file_path):
14
+ with open(file_path) as f:
15
+ st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html=True)
16
+
17
  # function to run the enter button
18
  def run_function(documents):
19
  data = ""
 
79
  st.session_state.extracted_doc = False
80
  data = ""
81
 
82
+ enter_c1, enter_c2 = st.columns([0.5, 0.5])
83
+ with enter_c1:
84
+ if st.button("Enter"):
85
+ st.session_state.button_enter_doc = True
86
+ with enter_c2:
87
+ print()
88
 
89
  # the enter button
90
  if st.session_state.button_enter_doc:
 
121
  st.success(f"File saved successfully.")
122
 
123
  else:
124
+ clear_c1, clear_c2 = st.columns([0.5, 0.5])
125
  st.warning("Data not extracted")
126
+ with clear_c1:
127
+ if st.button("clear"):
128
+ st.session_state.button_enter_doc = False
129
+ st.session_state.extracted_doc = False
130
+ st.experimental_rerun()
131
+ with clear_c2:
132
+ print()
133
+ st.write("#")
134
+ st.write("#")
135
 
136
 
137
 
styles.css CHANGED
@@ -1,4 +1,4 @@
1
- /* .title {
2
  font-family: "Source Sans Pro", sans-serif;
3
  font-weight: 600;
4
  padding: 1.25rem 0px 1rem;
@@ -23,26 +23,9 @@
23
  font-size: 1.25pc;
24
  padding: 1.25rem 0px 1rem;
25
  margin: 0px;
26
- } */
27
 
28
- /* enter button */
29
- /* #root > div:nth-child(1) > div.withScreencast > div > div > div > section.main.css-rtltf8.egzxvld5 > div.block-container.css-1l97lnl.egzxvld4 > div:nth-child(1) > div > div:nth-child(3) > div.css-1bzkvni.e1tzin5v1 > div:nth-child(1) > div > div:nth-child(2) > div > button {
30
- width: 100%;
31
- } */
32
 
33
  button.css-1oz26th.edgvbvh10 {
34
  width: 100% !important;
35
  }
36
- /* #root > div:nth-child(1) > div.withScreencast > div > div > div > section > div:nth-child(1) {
37
- background-color: #3498db;
38
- padding: 5px;
39
- } */
40
-
41
- /* #root > div:nth-child(1) > div.withScreencast > div > div > div > section.css-1cypcdb.e1fqkh3o11 > div.css-6qob1r.e1fqkh3o3 > div.css-1b9x38r.e1fqkh3o2 > button{
42
- visibility: hidden;
43
- } */
44
-
45
-
46
- * {
47
- background: green !important;
48
- }
 
1
+ .title {
2
  font-family: "Source Sans Pro", sans-serif;
3
  font-weight: 600;
4
  padding: 1.25rem 0px 1rem;
 
23
  font-size: 1.25pc;
24
  padding: 1.25rem 0px 1rem;
25
  margin: 0px;
26
+ }
27
 
 
 
 
 
28
 
29
  button.css-1oz26th.edgvbvh10 {
30
  width: 100% !important;
31
  }