Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1041,7 +1041,8 @@ def build_interface() -> tuple[gr.Blocks, gr.Theme | None, str | None]:
|
|
| 1041 |
}
|
| 1042 |
|
| 1043 |
/* Card/Panel styling */
|
| 1044 |
-
|
|
|
|
| 1045 |
background: var(--glass-bg) !important;
|
| 1046 |
backdrop-filter: blur(12px);
|
| 1047 |
border: 1px solid var(--glass-border) !important;
|
|
@@ -1229,7 +1230,7 @@ def build_interface() -> tuple[gr.Blocks, gr.Theme | None, str | None]:
|
|
| 1229 |
)
|
| 1230 |
|
| 1231 |
# Dynamic source input based on selection
|
| 1232 |
-
with gr.Group(visible=True) as github_group:
|
| 1233 |
gr.Markdown("*Paste a GitHub repo URL and click **Analyze** to extract docs. Then **Index** to enable RAG chat. You can see retrieved contents in the **Preview** tab on the right.*")
|
| 1234 |
github_url = gr.Textbox(
|
| 1235 |
label="Repository URL",
|
|
@@ -1252,7 +1253,7 @@ def build_interface() -> tuple[gr.Blocks, gr.Theme | None, str | None]:
|
|
| 1252 |
with gr.Row():
|
| 1253 |
github_notepad_download = gr.DownloadButton("π₯ Download as .md", variant="secondary", size="sm")
|
| 1254 |
|
| 1255 |
-
with gr.Group(visible=False) as local_group:
|
| 1256 |
gr.Markdown("*Upload a project folder. Irrelevant files are auto-filtered. You can see retrieved contents in the **Preview** tab on the right.*")
|
| 1257 |
local_folder = gr.File(
|
| 1258 |
label="Upload Project Folder",
|
|
@@ -1275,7 +1276,7 @@ def build_interface() -> tuple[gr.Blocks, gr.Theme | None, str | None]:
|
|
| 1275 |
with gr.Row():
|
| 1276 |
local_notepad_download = gr.DownloadButton("π₯ Download as .md", variant="secondary", size="sm")
|
| 1277 |
|
| 1278 |
-
with gr.Group(visible=False) as youtube_group:
|
| 1279 |
gr.Markdown("*Paste a YouTube video URL to extract and analyze the transcript. You can see retrieved contents in the **Preview** tab on the right.*")
|
| 1280 |
youtube_url = gr.Textbox(
|
| 1281 |
label="Video URL",
|
|
@@ -1300,9 +1301,9 @@ def build_interface() -> tuple[gr.Blocks, gr.Theme | None, str | None]:
|
|
| 1300 |
# Source type switching logic
|
| 1301 |
def switch_source(choice):
|
| 1302 |
return (
|
| 1303 |
-
gr.
|
| 1304 |
-
gr.
|
| 1305 |
-
gr.
|
| 1306 |
)
|
| 1307 |
|
| 1308 |
source_type.change(
|
|
@@ -1357,7 +1358,7 @@ def build_interface() -> tuple[gr.Blocks, gr.Theme | None, str | None]:
|
|
| 1357 |
)
|
| 1358 |
|
| 1359 |
# Chat Interface
|
| 1360 |
-
with gr.Group(visible=True) as chat_panel:
|
| 1361 |
with gr.Group(elem_classes=["box-container"]):
|
| 1362 |
gr.Markdown("### π Knowledge Assistant")
|
| 1363 |
gr.Markdown("*Hover over messages to see copy icon. Use toggles below to augment with web/wiki search.*")
|
|
@@ -1461,7 +1462,7 @@ def build_interface() -> tuple[gr.Blocks, gr.Theme | None, str | None]:
|
|
| 1461 |
)
|
| 1462 |
|
| 1463 |
# Preview Interface
|
| 1464 |
-
with gr.Group(visible=False) as preview_panel:
|
| 1465 |
gr.Markdown("### π Document Preview")
|
| 1466 |
|
| 1467 |
with gr.Row():
|
|
@@ -1485,8 +1486,8 @@ def build_interface() -> tuple[gr.Blocks, gr.Theme | None, str | None]:
|
|
| 1485 |
# Panel switching logic
|
| 1486 |
def switch_panel(choice):
|
| 1487 |
return (
|
| 1488 |
-
gr.
|
| 1489 |
-
gr.
|
| 1490 |
)
|
| 1491 |
|
| 1492 |
right_panel_mode.change(
|
|
|
|
| 1041 |
}
|
| 1042 |
|
| 1043 |
/* Card/Panel styling */
|
| 1044 |
+
/* Card/Panel styling */
|
| 1045 |
+
.source-card, .gradio-group, .tabs, .tabitem, .box-container, .group-container {
|
| 1046 |
background: var(--glass-bg) !important;
|
| 1047 |
backdrop-filter: blur(12px);
|
| 1048 |
border: 1px solid var(--glass-border) !important;
|
|
|
|
| 1230 |
)
|
| 1231 |
|
| 1232 |
# Dynamic source input based on selection
|
| 1233 |
+
with gr.Group(visible=True, elem_classes=["group-container"]) as github_group:
|
| 1234 |
gr.Markdown("*Paste a GitHub repo URL and click **Analyze** to extract docs. Then **Index** to enable RAG chat. You can see retrieved contents in the **Preview** tab on the right.*")
|
| 1235 |
github_url = gr.Textbox(
|
| 1236 |
label="Repository URL",
|
|
|
|
| 1253 |
with gr.Row():
|
| 1254 |
github_notepad_download = gr.DownloadButton("π₯ Download as .md", variant="secondary", size="sm")
|
| 1255 |
|
| 1256 |
+
with gr.Group(visible=False, elem_classes=["group-container"]) as local_group:
|
| 1257 |
gr.Markdown("*Upload a project folder. Irrelevant files are auto-filtered. You can see retrieved contents in the **Preview** tab on the right.*")
|
| 1258 |
local_folder = gr.File(
|
| 1259 |
label="Upload Project Folder",
|
|
|
|
| 1276 |
with gr.Row():
|
| 1277 |
local_notepad_download = gr.DownloadButton("π₯ Download as .md", variant="secondary", size="sm")
|
| 1278 |
|
| 1279 |
+
with gr.Group(visible=False, elem_classes=["group-container"]) as youtube_group:
|
| 1280 |
gr.Markdown("*Paste a YouTube video URL to extract and analyze the transcript. You can see retrieved contents in the **Preview** tab on the right.*")
|
| 1281 |
youtube_url = gr.Textbox(
|
| 1282 |
label="Video URL",
|
|
|
|
| 1301 |
# Source type switching logic
|
| 1302 |
def switch_source(choice):
|
| 1303 |
return (
|
| 1304 |
+
gr.update(visible=("GitHub" in choice)),
|
| 1305 |
+
gr.update(visible=("Local" in choice)),
|
| 1306 |
+
gr.update(visible=("YouTube" in choice)),
|
| 1307 |
)
|
| 1308 |
|
| 1309 |
source_type.change(
|
|
|
|
| 1358 |
)
|
| 1359 |
|
| 1360 |
# Chat Interface
|
| 1361 |
+
with gr.Group(visible=True, elem_classes=["group-container"]) as chat_panel:
|
| 1362 |
with gr.Group(elem_classes=["box-container"]):
|
| 1363 |
gr.Markdown("### π Knowledge Assistant")
|
| 1364 |
gr.Markdown("*Hover over messages to see copy icon. Use toggles below to augment with web/wiki search.*")
|
|
|
|
| 1462 |
)
|
| 1463 |
|
| 1464 |
# Preview Interface
|
| 1465 |
+
with gr.Group(visible=False, elem_classes=["group-container"]) as preview_panel:
|
| 1466 |
gr.Markdown("### π Document Preview")
|
| 1467 |
|
| 1468 |
with gr.Row():
|
|
|
|
| 1486 |
# Panel switching logic
|
| 1487 |
def switch_panel(choice):
|
| 1488 |
return (
|
| 1489 |
+
gr.update(visible=("Chat" in choice)),
|
| 1490 |
+
gr.update(visible=("Preview" in choice)),
|
| 1491 |
)
|
| 1492 |
|
| 1493 |
right_panel_mode.change(
|