File size: 1,086 Bytes
5bfdfae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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)