Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -24,14 +24,15 @@ 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
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
35 |
|
36 |
if st.session_state.stage == "prompt-input":
|
37 |
prompt = st.text_area("Ask the documentation a question :")
|
|
|
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 not (st.session_state.stage == "remove-crawl"):
|
28 |
+
if config and config_btn:
|
29 |
+
start = config.split(",")[0]
|
30 |
+
limit = int(config.split(",")[1])
|
31 |
+
|
32 |
+
txt = crawl_the_site.crawl(start,limit)
|
33 |
+
st.session_state.collection = create_database.create_database(txt)
|
34 |
+
st.write("Crawling is done.")
|
35 |
+
st.session_state.stage = "remove-crawl"
|
36 |
|
37 |
if st.session_state.stage == "prompt-input":
|
38 |
prompt = st.text_area("Ask the documentation a question :")
|