Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
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 |
-
|
| 15 |
-
iface = gr.
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 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()
|