Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,24 +1,26 @@
|
|
| 1 |
-
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,history):
|
| 6 |
-
# Index the input text
|
| 7 |
-
vectorstore = index_text()
|
| 8 |
-
|
| 9 |
-
# Answer the query based on the indexed text
|
| 10 |
-
answer = answer_query(query, vectorstore)
|
| 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 |
-
|
|
|
|
|
|
|
| 24 |
iface.launch()
|
|
|
|
| 1 |
+
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,history):
|
| 6 |
+
# Index the input text
|
| 7 |
+
vectorstore = index_text()
|
| 8 |
+
|
| 9 |
+
# Answer the query based on the indexed text
|
| 10 |
+
answer = answer_query(query, vectorstore)
|
| 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 |
+
theme="ocean"
|
| 21 |
+
examples=["What is Instrumental Efficiency?"]
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
# Launch the app
|
| 26 |
iface.launch()
|