File size: 691 Bytes
d93a08a
 
 
 
 
 
 
 
 
e20cf0f
d93a08a
 
 
 
 
 
 
775a08c
d93a08a
485a94f
 
1dadaea
485a94f
d93a08a
 
 
 
44ab0cd
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
import gradio as gr
from indexer import index_text, answer_query

# Gradio interface function to handle the RAG system
def rag_system(query,history):
    # Index the input text
    vectorstore = index_text()
    
    # Answer the query based on the indexed text
    answer = answer_query(query,history, vectorstore)
    
    return answer


iface = gr.ChatInterface(
    rag_system,
    type="messages",
    chatbot=gr.Chatbot(height=600,placeholder="Let's understand AI Alignment"),
    title="AI Alignment ChatBot",
textbox=gr.Textbox(placeholder="Ask Anything", container=True, scale=10),
    theme="Origin",
examples=["What is Orthogonality Thesis?"]

)


# Launch the app
iface.launch()