Spaces:
Runtime error
Runtime error
Remove proceed button after finishing
Browse files
app.py
CHANGED
@@ -70,6 +70,7 @@ def main():
|
|
70 |
if 'few_documents' not in st.session_state:
|
71 |
st.session_state['few_documents'] = False
|
72 |
few_documents = False
|
|
|
73 |
else:
|
74 |
few_documents = st.session_state['few_documents']
|
75 |
|
@@ -101,8 +102,12 @@ def main():
|
|
101 |
if few_documents:
|
102 |
error_msg = st.empty()
|
103 |
error_msg.warning(st.session_state['msg'])
|
104 |
-
|
105 |
-
if
|
|
|
|
|
|
|
|
|
106 |
query = translate(query_pt, 'pt', 'en') if portuguese else query
|
107 |
text = extract(query, search_model=search_model, extracted_documents=st.session_state['documents'])
|
108 |
summary = summarize(text, summ_model, tokenizer)
|
@@ -117,6 +122,7 @@ def main():
|
|
117 |
st.markdown(text.replace('\n', '\n\n'))
|
118 |
|
119 |
error_msg.empty()
|
|
|
120 |
st.session_state['few_documents'] = False
|
121 |
few_documents = False
|
122 |
|
|
|
70 |
if 'few_documents' not in st.session_state:
|
71 |
st.session_state['few_documents'] = False
|
72 |
few_documents = False
|
73 |
+
Timer.reset()
|
74 |
else:
|
75 |
few_documents = st.session_state['few_documents']
|
76 |
|
|
|
102 |
if few_documents:
|
103 |
error_msg = st.empty()
|
104 |
error_msg.warning(st.session_state['msg'])
|
105 |
+
proceed = st.empty()
|
106 |
+
if portuguese:
|
107 |
+
proceed_button = proceed.button('Prosseguir')
|
108 |
+
else:
|
109 |
+
proceed_button = proceed.button('Proceed')
|
110 |
+
if proceed_button:
|
111 |
query = translate(query_pt, 'pt', 'en') if portuguese else query
|
112 |
text = extract(query, search_model=search_model, extracted_documents=st.session_state['documents'])
|
113 |
summary = summarize(text, summ_model, tokenizer)
|
|
|
122 |
st.markdown(text.replace('\n', '\n\n'))
|
123 |
|
124 |
error_msg.empty()
|
125 |
+
proceed.empty()
|
126 |
st.session_state['few_documents'] = False
|
127 |
few_documents = False
|
128 |
|