Spaces:
Runtime error
Runtime error
| 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, vectorstore) | |
| return answer | |
| iface = gr.ChatInterface( | |
| rag_system, | |
| type="messages", | |
| chatbot=gr.Chatbot(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 Instrumental Efficiency?"] | |
| ) | |
| # Launch the app | |
| iface.launch() |