Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
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 :")
|