Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -202,14 +202,14 @@ def show_file_manager():
|
|
| 202 |
with open(uploaded_file.name, "wb") as f:
|
| 203 |
f.write(uploaded_file.getvalue())
|
| 204 |
st.success(f"Uploaded: {uploaded_file.name}")
|
| 205 |
-
st.
|
| 206 |
|
| 207 |
with col2:
|
| 208 |
if st.button("π Clear All Files"):
|
| 209 |
for f in glob.glob("*.txt") + glob.glob("*.md") + glob.glob("*.mp3"):
|
| 210 |
os.remove(f)
|
| 211 |
st.success("All files cleared!")
|
| 212 |
-
st.
|
| 213 |
|
| 214 |
files = glob.glob("*.txt") + glob.glob("*.md") + glob.glob("*.mp3")
|
| 215 |
if files:
|
|
@@ -223,7 +223,7 @@ def show_file_manager():
|
|
| 223 |
st.text_area("Content", file.read(), height=100)
|
| 224 |
if st.button(f"Delete {os.path.basename(f)}", key=f"del_{f}"):
|
| 225 |
os.remove(f)
|
| 226 |
-
st.
|
| 227 |
|
| 228 |
def arxiv_search(query, max_results=5):
|
| 229 |
"""Perform a simple Arxiv search using their API and return top results."""
|
|
@@ -397,7 +397,7 @@ def main():
|
|
| 397 |
st.subheader("βοΈ Settings & History")
|
| 398 |
if st.button("ποΈ Clear History"):
|
| 399 |
st.session_state['search_history'] = []
|
| 400 |
-
st.
|
| 401 |
|
| 402 |
st.markdown("### Recent Searches")
|
| 403 |
for entry in reversed(st.session_state['search_history'][-5:]):
|
|
|
|
| 202 |
with open(uploaded_file.name, "wb") as f:
|
| 203 |
f.write(uploaded_file.getvalue())
|
| 204 |
st.success(f"Uploaded: {uploaded_file.name}")
|
| 205 |
+
st.rerun()
|
| 206 |
|
| 207 |
with col2:
|
| 208 |
if st.button("π Clear All Files"):
|
| 209 |
for f in glob.glob("*.txt") + glob.glob("*.md") + glob.glob("*.mp3"):
|
| 210 |
os.remove(f)
|
| 211 |
st.success("All files cleared!")
|
| 212 |
+
st.rerun()
|
| 213 |
|
| 214 |
files = glob.glob("*.txt") + glob.glob("*.md") + glob.glob("*.mp3")
|
| 215 |
if files:
|
|
|
|
| 223 |
st.text_area("Content", file.read(), height=100)
|
| 224 |
if st.button(f"Delete {os.path.basename(f)}", key=f"del_{f}"):
|
| 225 |
os.remove(f)
|
| 226 |
+
st.rerun()
|
| 227 |
|
| 228 |
def arxiv_search(query, max_results=5):
|
| 229 |
"""Perform a simple Arxiv search using their API and return top results."""
|
|
|
|
| 397 |
st.subheader("βοΈ Settings & History")
|
| 398 |
if st.button("ποΈ Clear History"):
|
| 399 |
st.session_state['search_history'] = []
|
| 400 |
+
st.rerun()
|
| 401 |
|
| 402 |
st.markdown("### Recent Searches")
|
| 403 |
for entry in reversed(st.session_state['search_history'][-5:]):
|