Spaces:
Running
Running
siddhartharya
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
# app.py
|
2 |
-
|
3 |
import gradio as gr
|
4 |
from bs4 import BeautifulSoup
|
5 |
import requests
|
@@ -343,6 +342,7 @@ def process_uploaded_file(file, state_bookmarks):
|
|
343 |
def delete_selected_bookmarks(selected_indices, state_bookmarks):
|
344 |
if not selected_indices:
|
345 |
return "β οΈ No bookmarks selected.", gr.update(choices=[]), ""
|
|
|
346 |
bookmarks = state_bookmarks[0]
|
347 |
indices = []
|
348 |
for s in selected_indices:
|
@@ -514,6 +514,10 @@ SmartMarks is divided into three main sections:
|
|
514 |
Navigate through the tabs to explore each feature in detail.
|
515 |
""")
|
516 |
|
|
|
|
|
|
|
|
|
517 |
# Upload and Process Bookmarks Tab
|
518 |
with gr.Tab("Upload and Process Bookmarks"):
|
519 |
gr.Markdown("""
|
@@ -541,7 +545,7 @@ Navigate through the tabs to explore each feature in detail.
|
|
541 |
process_button.click(
|
542 |
process_uploaded_file,
|
543 |
inputs=[upload, state_bookmarks],
|
544 |
-
outputs=[output_text, bookmark_display,
|
545 |
)
|
546 |
|
547 |
# Chat with Bookmarks Tab
|
@@ -616,14 +620,12 @@ Navigate through the tabs to explore each feature in detail.
|
|
616 |
""")
|
617 |
|
618 |
manage_output = gr.Textbox(label="π Manage Output", interactive=False)
|
619 |
-
bookmark_selector = gr.CheckboxGroup(label="β
Select Bookmarks", choices=[])
|
620 |
new_category_input = gr.Dropdown(label="π New Category", choices=CATEGORIES, value="Uncategorized")
|
621 |
with gr.Row():
|
622 |
delete_button = gr.Button("ποΈ Delete Selected Bookmarks")
|
623 |
edit_category_button = gr.Button("βοΈ Edit Category of Selected Bookmarks")
|
624 |
export_button = gr.Button("πΎ Export Bookmarks")
|
625 |
download_link = gr.HTML(label="π₯ Download Exported Bookmarks")
|
626 |
-
bookmark_display_manage = gr.HTML(label="π Manage Bookmarks Display")
|
627 |
refresh_button = gr.Button("π Refresh Bookmarks")
|
628 |
|
629 |
# Define button actions
|
|
|
1 |
# app.py
|
|
|
2 |
import gradio as gr
|
3 |
from bs4 import BeautifulSoup
|
4 |
import requests
|
|
|
342 |
def delete_selected_bookmarks(selected_indices, state_bookmarks):
|
343 |
if not selected_indices:
|
344 |
return "β οΈ No bookmarks selected.", gr.update(choices=[]), ""
|
345 |
+
|
346 |
bookmarks = state_bookmarks[0]
|
347 |
indices = []
|
348 |
for s in selected_indices:
|
|
|
514 |
Navigate through the tabs to explore each feature in detail.
|
515 |
""")
|
516 |
|
517 |
+
# Define Manage Bookmarks components outside the tab for global access
|
518 |
+
bookmark_selector = gr.CheckboxGroup(label="β
Select Bookmarks", choices=[])
|
519 |
+
bookmark_display_manage = gr.HTML(label="π Manage Bookmarks Display")
|
520 |
+
|
521 |
# Upload and Process Bookmarks Tab
|
522 |
with gr.Tab("Upload and Process Bookmarks"):
|
523 |
gr.Markdown("""
|
|
|
545 |
process_button.click(
|
546 |
process_uploaded_file,
|
547 |
inputs=[upload, state_bookmarks],
|
548 |
+
outputs=[output_text, bookmark_display, bookmark_selector, bookmark_display_manage]
|
549 |
)
|
550 |
|
551 |
# Chat with Bookmarks Tab
|
|
|
620 |
""")
|
621 |
|
622 |
manage_output = gr.Textbox(label="π Manage Output", interactive=False)
|
|
|
623 |
new_category_input = gr.Dropdown(label="π New Category", choices=CATEGORIES, value="Uncategorized")
|
624 |
with gr.Row():
|
625 |
delete_button = gr.Button("ποΈ Delete Selected Bookmarks")
|
626 |
edit_category_button = gr.Button("βοΈ Edit Category of Selected Bookmarks")
|
627 |
export_button = gr.Button("πΎ Export Bookmarks")
|
628 |
download_link = gr.HTML(label="π₯ Download Exported Bookmarks")
|
|
|
629 |
refresh_button = gr.Button("π Refresh Bookmarks")
|
630 |
|
631 |
# Define button actions
|