Spaces:
Runtime error
Runtime error
import gradio as gr | |
from pages.initial_and_upload import Initial_and_Upload | |
from pages.chat_search import ChatSearch | |
from vector_db.vector_db_client import VectorDB | |
main_css = """ | |
.secondary.svelte-cmf5ev { | |
background: #6366f1; | |
color: #ffffff; | |
} | |
.main-text { | |
color: #6366f1; | |
padding-top: 20px; | |
text-align: center; | |
} | |
.main-title { | |
font-size: 28px; | |
font-weight: bold; | |
padding-top: 10px; | |
padding-bottom: 15px; | |
color: #6366f1; | |
text-align: center; | |
} | |
""" | |
def init_pages(vdb: VectorDB, server_name: str, server_port,config): | |
initial_and_upload = Initial_and_Upload(config,vdb) | |
chat_search=ChatSearch(config,vdb) | |
with gr.Blocks(title="Tencent VectorDB", theme="soft", css=main_css) as demo: | |
with gr.Row(): | |
gr.HTML("<div class='main-title'>Tencent VectorDB AI Demo -- Graph search</div>") | |
with gr.Tab("初始化页面"): | |
initial_and_upload.get_init_panel() | |
with gr.Tab("图搜图界面"): | |
chat_search.get_chart() | |
demo.launch(server_name=server_name, server_port=server_port) | |