-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
37 lines (33 loc) · 2.3 KB
/
app.py
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
import gradio as gr
import bot
import os
import vector_store_builder
# if not os.path.isdir('./kb_chroma_db'):
# print('Vector store building...')
# vector_store_builder.build_vector_store()
kb_bot = bot.KnowledgeBaseBot(persist_directory='./kb_chroma_db')
# Set up chatbot interface
answer_bot = gr.ChatInterface(kb_bot.process_chat,
chatbot=gr.Chatbot(type="tuples"),
textbox=gr.Textbox(placeholder="Type your question about the FAIRiCUBE project or "
"knowledge base here...", container=False,
scale=7),
title="FAIRiCUBE Knowledge Base ChatBot",
description="The FAIRiCUBE Knowledge Base ChatBot is an intelligent assistant designed "
"to help understand the FAIRiCUBE project. This chatbot acts as a guide to "
"FAIRiCUBE’s resources, answering questions about its objectives, "
"methodologies, and knowledge base. Whether you’re a researcher, "
"policymaker, or developer, the ChatBot provides insights into FAIRiCUBE’s "
"tools, use cases, analysis and processing resources, datasets, "
"and applications in environmental and spatial data science. With an "
"intuitive interface, it efficiently retrieves project information, "
"clarifies technical aspects, and directs users to relevant documents and "
"data sources within the FAIRiCUBE knowledge base. "
"\n\nUse the text box at the bottom of the page to ask your question about the FAIRiCUBE project and the Knowledge Base.",
theme="soft",
stop_btn="Interrupt",
submit_btn="Ask",
type="tuples"
)
answer_bot.queue(default_concurrency_limit=None)
answer_bot.launch(share=True)