Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,8 @@ prompt_template = """Answer the question only according to the information provi
|
|
15 |
# {}"""
|
16 |
|
17 |
try:
|
18 |
-
st.session_state.stage
|
|
|
19 |
except Exception:
|
20 |
st.session_state.stage = "crawl-input"
|
21 |
|
@@ -30,7 +31,7 @@ if st.session_state.stage == "crawl-input":
|
|
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 = "
|
34 |
|
35 |
if st.session_state.stage == "prompt-input":
|
36 |
prompt = st.text_area("What would you like to chat about?")
|
@@ -53,4 +54,4 @@ if st.session_state.stage == "prompt-input":
|
|
53 |
model="deepseek/deepseek-r1:free",
|
54 |
messages=[{"role":"user","content":prompt}])
|
55 |
|
56 |
-
st.write((completion.choices[0].message.content)
|
|
|
15 |
# {}"""
|
16 |
|
17 |
try:
|
18 |
+
if st.session_state.stage == "remove-crawl":
|
19 |
+
st.session_state.stage = "prompt-input"
|
20 |
except Exception:
|
21 |
st.session_state.stage = "crawl-input"
|
22 |
|
|
|
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"
|
35 |
|
36 |
if st.session_state.stage == "prompt-input":
|
37 |
prompt = st.text_area("What would you like to chat about?")
|
|
|
54 |
model="deepseek/deepseek-r1:free",
|
55 |
messages=[{"role":"user","content":prompt}])
|
56 |
|
57 |
+
st.write((completion.choices[0].message.content))
|