mehmet0001 commited on
Commit
a401978
·
verified ·
1 Parent(s): f5ca240

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -16
app.py CHANGED
@@ -19,22 +19,18 @@ if not "stage" in st.session_state:
19
  elif st.session_state.stage == "remove-crawl-input-widgets":
20
  st.session_state.stage = "prompt-input"
21
 
22
- def get_crawl_input():
23
- if st.session_state.stage == "crawl-input":
24
- config = st.text_area("Enter the start URL and the limit of crawling (in this format : URL,limit):")
25
- config_btn = st.button("Start crawling!")
26
-
27
- if config and config_btn:
28
- start = config.split(",")[0]
29
- limit = int(config.split(",")[1])
30
-
31
- txt = crawl_the_site.crawl(start,limit)
32
- st.session_state.collection = create_database.create_database(txt)
33
- st.write("Crawling is done.")
34
- st.session_state.stage = "remove-crawl-input-widgets"
35
- return
36
-
37
- get_crawl_input()
38
 
39
  if st.session_state.stage == "prompt-input":
40
  prompt = st.text_area("Ask the documentation a question :")
 
19
  elif st.session_state.stage == "remove-crawl-input-widgets":
20
  st.session_state.stage = "prompt-input"
21
 
22
+ if st.session_state.stage == "crawl-input":
23
+ config = st.text_area("Enter the start URL and the limit of crawling (in this format : URL,limit):")
24
+ config_btn = st.button("Start crawling!")
25
+
26
+ if config and config_btn:
27
+ start = config.split(",")[0]
28
+ limit = int(config.split(",")[1])
29
+
30
+ txt = crawl_the_site.crawl(start,limit)
31
+ st.session_state.collection = create_database.create_database(txt)
32
+ st.write("Crawling is done.")
33
+ st.session_state.stage = "remove-crawl-input-widgets"
 
 
 
 
34
 
35
  if st.session_state.stage == "prompt-input":
36
  prompt = st.text_area("Ask the documentation a question :")