dsouzaJithesh commited on
Commit
9c25c7f
·
verified ·
1 Parent(s): dba4853

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
2
  from indexer import index_text, answer_query
3
 
4
  # Gradio interface function to handle the RAG system
5
- def rag_system(query):
6
  # Index the input text
7
  vectorstore = index_text()
8
 
@@ -11,14 +11,14 @@ def rag_system(query):
11
 
12
  return answer
13
 
14
- # Build the Gradio interface
15
- iface = gr.Interface(
16
- fn=rag_system,
17
- inputs=["text"],
18
- outputs="text",
19
- title="AI Alignment Bot",
20
- description="If the model can't answer, it will say sorry I don't know"
21
  )
22
 
 
23
  # Launch the app
24
  iface.launch()
 
2
  from indexer import index_text, answer_query
3
 
4
  # Gradio interface function to handle the RAG system
5
+ def rag_system(query,history):
6
  # Index the input text
7
  vectorstore = index_text()
8
 
 
11
 
12
  return answer
13
 
14
+
15
+ iface = gr.ChatInterface(
16
+ rag_system,
17
+ type="messages",
18
+ title="AI Alignment ChatBot",
19
+ description="Let's understand AI Alignment",
 
20
  )
21
 
22
+
23
  # Launch the app
24
  iface.launch()