4 / app_old5.py
Adi12345's picture
Rename app.py to app_old5.py
4d2522e verified
Raw
History Blame Contribute Delete
2.12 kB
"""
DVNC.AI β€” root app.py
Fixed: corrected all imports to use dvnc_ai_v2_hf package with proper underscore function names.
"""
# ── Standard library ──────────────────────────────────────────────────────
import html
import random
import re
import sys
from pathlib import Path
from typing import Dict, List, Optional
# Ensure repository root is on sys.path
ROOT = Path(__file__).resolve().parent
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
# ── Third-party ───────────────────────────────────────────────────────────
import gradio as gr
# ── Internal modules ──────────────────────────────────────────────────────
from dvnc_ai_v2_hf.agent_route_cards import build_agent_route_cards_html
from dvnc_ai_v2_hf.discovery_app_bridge import (
get_default_route_state,
get_discovery_css,
get_initial_discovery_timeline_html,
)
from dvnc_ai_v2_hf.dvnc_ui_layout import get_dvnc_layout_css
from dvnc_ai_v2_hf.graph_canvas_patch import render_graph_canvas_html
from dvnc_ai_v2_hf.self_learning_graph import (
DEFAULT_SOURCES,
SEARCH_MODES,
SOURCE_OPTIONS,
build_journal_html,
ingest_selected_papers,
parse_uploaded_pdf,
render_parse_result,
run_paper_discovery,
safe_text,
)
# ── Simplified launcher: use existing app from dvnc_ai_v2_hf ─────────────
if __name__ == "__main__":
try:
from dvnc_ai_v2_hf import app as internal_app
internal_app.demo.launch()
except (ImportError, AttributeError):
print("Could not import dvnc_ai_v2_hf.app β€” falling back to minimal Gradio demo")
with gr.Blocks() as demo:
gr.Markdown("# DVNC.AI\n\nSpace configuration in progress. Check Files tab for dvnc_ai_v2_hf/app.py")
demo.launch()